[OpenWrt-Devel] [PATCH] [base-files] show hint when JFFS2-partition is full and overlayfs mounted read-only

2015-06-03 Thread Bastian Bittorf
since r45833 and r45848 the overlayfs is automatically mounted read-only
(and blocks remounts as r/w) when JFFS2 is full. see ticket #19564

because of this normal file deletion is not possible anymore.
if a user logins interactively (e.g. SSH) show a hint for this,
that files must be removed in /overlay/upper/...

Signed-off-by: Bastian Bittorf bitt...@bluebottle.com
---
 package/base-files/files/etc/profile |4 
 1 file changed, 4 insertions(+)

diff --git a/package/base-files/files/etc/profile 
b/package/base-files/files/etc/profile
index 3dd58e1..007baf0 100644
--- a/package/base-files/files/etc/profile
+++ b/package/base-files/files/etc/profile
@@ -1,6 +1,10 @@
 #!/bin/sh
 [ -f /etc/banner ]  cat /etc/banner
 [ -e /tmp/.failsafe ]  cat /etc/banner.failsafe
+fgrep -sq '/ overlay ro,' /proc/mounts  {
+   echo 'Your JFFS2-partition seems full and overlayfs is mounted 
read-only.'
+   echo 'Please try to remove files from /overlay/upper/... and reboot!'
+}
 
 export PATH=/usr/bin:/usr/sbin:/bin:/sbin
 export HOME=$(grep -e ^${USER:-root}: /etc/passwd | cut -d : -f 6)
-- 
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] ar71xx: How to integrate UniFi AP Outdoor Plus HSR?

2015-06-03 Thread Stefan Rompf
Hi Felix,

 I think deferring this to user space might mess up timings during fast
 active scans. I'd prefer to have a callback in ath9k_platform.h that
 allows the platform code to provide a hook which implements this.
 That way the changes to ath9k stay very small, and the code is still
 quite simple.

this would move the hsr driver into the kernel image, wouldn't it? That's IMHO 
a maintenance nightmare as it would force us to flash a new image whenever we 
want to update or even debug the driver.

What about this solution:

-Add the possibility to register a channel change helper in ath9k.ko. As with 
your idea, this is only a very small patch that all ar71xx targets would 
have to carry.
-Make the hsr driver a channel change helper .ko
-Install the hsr kernel module only into the UniFi Outdoor Plus image.

Like in the attached RFC patch (that has be applied manually).

Stefan
diff -Nur linux/drivers/net/wireless/ath9k.orig/ath/ath9k.h linux/drivers/net/wireless/ath9k/ath/ath9k.h
--- linux/drivers/net/wireless/ath/ath9k.orig/ath9k.h	2015-04-04 04:46:37.0 +0200
+++ linux/drivers/net/wireless/ath/ath9k/ath9k.h	2015-06-03 18:37:29.0 +0200
@@ -1098,4 +1098,10 @@
 static inline void ath_ahb_exit(void) {};
 #endif
 
+/*
+ * OpenWrt UBNT HSR filter support
+ */
+typedef void (set_channel_helper_fn)(struct ath_hw* ah, int bw, int fq);
+void ath9k_register_set_channel_helper(set_channel_helper_fn *);
+
 #endif /* ATH9K_H */
diff -Nur linux/drivers/net/wireless/ath/ath9k.orig/channel.c linux/drivers/net/wireless/ath/ath9k/channel.c
--- linux/drivers/net/wireless/ath/ath9k.orig/channel.c	2015-04-04 04:46:37.0 +0200
+++ linux/drivers/net/wireless/ath/ath9k/channel.c	2015-06-03 18:42:28.0 +0200
@@ -16,6 +16,18 @@
 
 #include ath9k.h
 
+/*
+ * OpenWrt UBNT HSR filter support
+ */
+static set_channel_helper_fn *ath9k_set_channel_helper;
+
+void ath9k_register_set_channel_helper(set_channel_helper_fn *chanfn)
+{
+	ath9k_set_channel_helper = chanfn;
+}
+EXPORT_SYMBOL(ath9k_register_set_channel_helper);
+
+
 /* Set/change channels.  If the channel is really being changed, it's done
  * by reseting the chip.  To accomplish this we must first cleanup any pending
  * DMA, then restart stuff.
@@ -41,6 +53,9 @@
 	ath_dbg(common, CONFIG, Set channel: %d MHz width: %d\n,
 		chan-center_freq, chandef-width);
 
+	if (ath9k_set_channel_helper)
+		ath9k_set_channel_helper(ah, chandef-width, chan-center_freq);
+
 	/* update survey stats for the old channel before switching */
 	spin_lock_bh(common-cc_lock);
 	ath_update_survey_stats(sc);
diff -Nur linux/drivers/net/wireless/ath/ath9k.orig/hsr.c linux/drivers/net/wireless/ath/ath9k/hsr.c
--- linux/drivers/net/wireless/ath/ath9k.orig/hsr.c	1970-01-01 01:00:00.0 +0100
+++ linux/drivers/net/wireless/ath/ath9k/hsr.c	2015-06-03 18:45:04.0 +0200
@@ -0,0 +1,283 @@
+/*
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2015 Kirill Berezin
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the Software), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include linux/io.h
+#include linux/slab.h
+#include linux/module.h
+#include linux/time.h
+#include linux/bitops.h
+#include linux/etherdevice.h
+#include linux/rtnetlink.h
+#include asm/unaligned.h
+
+#include hw.h
+#include hw-ops.h
+#include ar9003_mac.h
+#include ar9003_mci.h
+#include ar9003_phy.h
+#include ath9k.h
+
+#define HSR_GPIO_CSN 8
+#define HSR_GPIO_CLK 6
+#define HSR_GPIO_DOUT 7
+#define HSR_GPIO_DIN 5
+
+/* delays are in useconds */
+#define HSR_DELAY_HALF_TICK 100
+#define HSR_DELAY_PRE_WRITE 75
+#define HSR_DELAY_FINAL 2
+#define HSR_DELAY_TRAILING 200
+
+static void hsr_init(struct ath_hw* ah);
+static int hsr_disable(struct ath_hw* ah);
+static int hsr_enable(struct ath_hw* ah, int bw, int fq);
+static int hsr_status(struct ath_hw* ah);
+
+static void hsr_init(struct ath_hw* ah) {
+
+	if ( NULL == ah) {
+		return;
+	}
+
+	ath9k_hw_cfg_gpio_input(ah, HSR_GPIO_DIN);
+	ath9k_hw_cfg_output(ah, HSR_GPIO_CSN, 

Re: [OpenWrt-Devel] [PATCH] Add sch_fq and sch_pie to the kmod-sched package.

2015-06-03 Thread Toke Høiland-Jørgensen
Etienne Champetier champetier.etie...@gmail.com writes:

 what is the size of the image/.ipk with/without this option ? 

The .ipk goes from 46018 to 52793 bytes. Can't seem to get the image
size to change, probably some issue with my build setup...

-Toke
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Add sch_fq and sch_pie to the kmod-sched package.

2015-06-03 Thread Jo-Philipp Wich
Hi,

 The .ipk goes from 46018 to 52793 bytes. Can't seem to get the image
 size to change, probably some issue with my build setup...

The image is padded to whole eraseblocks, so if the squashfs size does
not change then the added code fits into the remaining space of an
eraseblock.

~ Jow



signature.asc
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ar71xx: fix AR71XX_MODEL for TP-Link TL-WA830RE v1

2015-06-03 Thread Matthias Schiffer
The v1 identifies as v10 internally. As there is no TL-WA830RE v10, add a
workaround to avoid confusing users.

Signed-off-by: Matthias Schiffer mschif...@universe-factory.net
---
 target/linux/ar71xx/base-files/lib/ar71xx.sh | 4 
 1 file changed, 4 insertions(+)

diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index d5dd561..b13be1e 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -151,6 +151,10 @@ tplink_board_detect() {
;;
083000*)
model=TP-Link TL-WA830RE
+
+   if [ $hwver = 'v10' ]; then
+   hwver='v1'
+   fi
;;
084100*)
model=TP-Link TL-WR841N/ND
-- 
2.4.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Regarding bridge multicast-to-unicast patch

2015-06-03 Thread Linus Lüssing
On Wed, Jun 03, 2015 at 07:25:32PM +0200, Steven Barth wrote:
 
 
 
 Steven, could you elaborate a little more on the scenario and
 explain why it is a must to shut up automatically when having a
 local user-space querier? If people are able to manually install and
 configure a complex multicast router, aren't they capable of
 manually disabling the bridge querier, too (there's even a netifd
 option for that)?
 
 I'm not thinking about complex router setups but instead about simple SSM 
 capable proxies (i.e. mcproxy and the like). I think thats a valid point and 
 don't see why v6 behaves rather awkwardly compared to v4 which simply goes 
 silent.

Hm, actually I would have thought the simply going silent a little
awkward because it's not what the IGMP/MRD standards mandate. And
that could lead to some down time if for instance two bridges
decide to shut up because of bad timing. The lower address
requirement in the querier election was supposed to take care of
that awkwardness. On the other hand using zero-source addresses
basically breaks the election mechanism too, so I guess it's ok to
shut up in that case...

 If i run a userspace querier the kernel should shut up otherwise the 
 userspace querier might get utterly confused since its suddenly competing 
 against itself in the election.

Ah, right, they use the same source address, good point! And for
that case, if the source addresses are the same then the bridge
already does that, both for IPv4 and IPv6 :). If receiving the
same source address as the own one, then it will select that
entity (no matter if from above the bridge or any bridge port),
as the new querier and will shut up. (compare
br_ip{6,}_multicast_select_querier())

 
 I mean the kernel can still do the mc- uc translation but simply let 
 userspace do the querying. Though i guess if all else fails we need to do 
 this manually using /proc writes in the init script hmmm...

Keep in mind that if we disabled the bridge querier by default
and if there is no userspace querier then we won't be able to
do mc-uc translation (or any multicast snooping). People wouldn't
be able to use their multicast streaming app with the OpenWRT
default configuration.

Cheers, Linus
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] base-files: default_do_upgrade: accept forward image extraction command

2015-06-03 Thread Rafał Miłecki
get_image allows passing 2nd argument that is used in a pipe for
extracting firmware from a non-native format. By accepting such command
in default_do_upgrade we allow platforms to use this helper for vendor
specific images.

Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
 package/base-files/files/lib/upgrade/common.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/base-files/files/lib/upgrade/common.sh 
b/package/base-files/files/lib/upgrade/common.sh
index 8cdabc6..07017cf 100644
--- a/package/base-files/files/lib/upgrade/common.sh
+++ b/package/base-files/files/lib/upgrade/common.sh
@@ -215,9 +215,9 @@ jffs2_copy_config() {
 default_do_upgrade() {
sync
if [ $SAVE_CONFIG -eq 1 ]; then
-   get_image $1 | mtd $MTD_CONFIG_ARGS -j $CONF_TAR write - 
${PART_NAME:-image}
+   get_image $1 $2 | mtd $MTD_CONFIG_ARGS -j $CONF_TAR write 
- ${PART_NAME:-image}
else
-   get_image $1 | mtd write - ${PART_NAME:-image}
+   get_image $1 $2 | mtd write - ${PART_NAME:-image}
fi
 }
 
-- 
1.8.4.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Regarding bridge multicast-to-unicast patch

2015-06-03 Thread Hans Dedecker
On Wed, Jun 3, 2015 at 8:50 AM, Steven Barth cy...@openwrt.org wrote:
 Thanks for the quick reply.


 On 03.06.2015 08:26, Linus Lüssing wrote:
 For IPv6 and a non-zero IPv4 source address it'll use the normal
 IGMP/MLD querier election mechanism, meaning the one with the lowest
 IP address will become the selected querier and the only one querying
 on the link.
 So especially for v6 - since the kernel doesn't do IGMPv3 / MLDv2 - this
 effectively downgrades all the bridge links to ASM then (at least with a
 50% chance, i.e. when the kernel wins due to lower MAC-address), which
 is a bit meh.

 Now remaining question is, does the kernel detect if there is a
 userspace-querier running on the same machine and silence itself then?
 If not we probably need to address this as well somehow.
I can confirm the bridge querier silence itself when an
userspace-querier is running at least for IGMP.
Did not check the MLD behavior yet.

Bye,
Hans


 Cheers,

 Steven
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [gre...@linuxfoundation.org: Patch ovl: mount read-only if workdir can't be created has been added to the 4.0-stable tree]

2015-06-03 Thread Bastian Bittorf
https://dev.openwrt.org/ticket/19564
we use it since r45848 - just to inform,
that there is no need for a special 4.0 
patch when it get merged.

bye, bastian

- Forwarded message from gre...@linuxfoundation.org -

Date: Wed, 03 Jun 2015 10:15:11 +0900
From: gre...@linuxfoundation.org
To: mszer...@suse.cz, bitt...@bluebottle.com, gre...@linuxfoundation.org
Cc: sta...@vger.kernel.org, stable-comm...@vger.kernel.org
Subject: Patch ovl: mount read-only if workdir can't be created has been 
added to the 4.0-stable tree


This is a note to let you know that I've just added the patch titled

ovl: mount read-only if workdir can't be created

to the 4.0-stable tree which can be found at:

http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
 ovl-mount-read-only-if-workdir-can-t-be-created.patch
and it can be found in the queue-4.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let sta...@vger.kernel.org know about it.


From cc6f67bcafcb62d1be1603dcd95125a52800 Mon Sep 17 00:00:00 2001
From: Miklos Szeredi mszer...@suse.cz
Date: Tue, 19 May 2015 14:30:12 +0200
Subject: ovl: mount read-only if workdir can't be created

From: Miklos Szeredi mszer...@suse.cz

commit cc6f67bcafcb62d1be1603dcd95125a52800 upstream.

OpenWRT folks reported that overlayfs fails to mount if upper fs is full,
because workdir can't be created.  Wordir creation can fail for various
other reasons too.

There's no reason that the mount itself should fail, overlayfs can work
fine without a workdir, as long as the overlay isn't modified.

So mount it read-only and don't allow remounting read-write.

Add a couple of WARN_ON()s for the impossible case of workdir being used
despite being read-only.

Reported-by: Bastian Bittorf bitt...@bluebottle.com
Signed-off-by: Miklos Szeredi mszer...@suse.cz
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 fs/overlayfs/copy_up.c |3 +++
 fs/overlayfs/dir.c |9 +
 fs/overlayfs/super.c   |   10 +-
 3 files changed, 17 insertions(+), 5 deletions(-)

--- a/fs/overlayfs/copy_up.c
+++ b/fs/overlayfs/copy_up.c
@@ -299,6 +299,9 @@ int ovl_copy_up_one(struct dentry *paren
struct cred *override_cred;
char *link = NULL;
 
+   if (WARN_ON(!workdir))
+   return -EROFS;
+
ovl_path_upper(parent, parentpath);
upperdir = parentpath.dentry;
 
--- a/fs/overlayfs/dir.c
+++ b/fs/overlayfs/dir.c
@@ -222,6 +222,9 @@ static struct dentry *ovl_clear_empty(st
struct kstat stat;
int err;
 
+   if (WARN_ON(!workdir))
+   return ERR_PTR(-EROFS);
+
err = ovl_lock_rename_workdir(workdir, upperdir);
if (err)
goto out;
@@ -322,6 +325,9 @@ static int ovl_create_over_whiteout(stru
struct dentry *newdentry;
int err;
 
+   if (WARN_ON(!workdir))
+   return -EROFS;
+
err = ovl_lock_rename_workdir(workdir, upperdir);
if (err)
goto out;
@@ -506,6 +512,9 @@ static int ovl_remove_and_whiteout(struc
struct dentry *opaquedir = NULL;
int err;
 
+   if (WARN_ON(!workdir))
+   return -EROFS;
+
if (is_dir) {
if (OVL_TYPE_MERGE_OR_LOWER(ovl_path_type(dentry))) {
opaquedir = ovl_check_empty_and_clear(dentry);
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -529,7 +529,7 @@ static int ovl_remount(struct super_bloc
 {
struct ovl_fs *ufs = sb-s_fs_info;
 
-   if (!(*flags  MS_RDONLY)  !ufs-upper_mnt)
+   if (!(*flags  MS_RDONLY)  (!ufs-upper_mnt || !ufs-workdir))
return -EROFS;
 
return 0;
@@ -925,9 +925,10 @@ static int ovl_fill_super(struct super_b
ufs-workdir = ovl_workdir_create(ufs-upper_mnt, 
workpath.dentry);
err = PTR_ERR(ufs-workdir);
if (IS_ERR(ufs-workdir)) {
-   pr_err(overlayfs: failed to create directory %s/%s\n,
-  ufs-config.workdir, OVL_WORKDIR_NAME);
-   goto out_put_upper_mnt;
+   pr_warn(overlayfs: failed to create directory %s/%s 
(errno: %i); mounting read-only\n,
+   ufs-config.workdir, OVL_WORKDIR_NAME, -err);
+   sb-s_flags |= MS_RDONLY;
+   ufs-workdir = NULL;
}
}
 
@@ -997,7 +998,6 @@ out_put_lower_mnt:
kfree(ufs-lower_mnt);
 out_put_workdir:
dput(ufs-workdir);
-out_put_upper_mnt:
mntput(ufs-upper_mnt);
 out_put_lowerpath:
for (i = 0; i  numlower; i++)


Patches currently in stable-queue which might be from mszer...@suse.cz are

queue-4.0/ovl-don-t-remove-non-empty-opaque-directory.patch
queue-4.0/ovl-mount-read-only-if-workdir-can-t-be-created.patch

- End forwarded message -

mit drahtlosen 

[OpenWrt-Devel] [PATCH 1/1] ramips: Add support for RT5350F-OLinuXino

2015-06-03 Thread gamishev
From: Dimitar Gamishev HeHoPMaJIeH gamis...@gmail.com

 Support for Olimex RT5350F-OLinuXino Boards, tested with RT5350F-OLinuXino and 
RT5350F-OLinuXino-EVB boards. More Info :
 
https://www.olimex.com/Products/OLinuXino/RT5350F/RT5350F-OLinuXino/open-source-hardware

Signed-off-by: Dimitar Gamishev HeHoPMaJIeH gamis...@gmail.com
---
 target/linux/ramips/base-files/lib/ramips.sh   |   6 ++
 .../ramips/base-files/lib/upgrade/platform.sh  |   4 +-
 target/linux/ramips/dts/OLINUXINO-RT5350F-EVB.dts  | 101 +
 target/linux/ramips/dts/OLINUXINO-RT5350F.dts  |  79 
 target/linux/ramips/image/Makefile |   8 ++
 .../rt305x/profiles/olinuxino-rt5350f-evb.mk   |  21 +
 .../ramips/rt305x/profiles/olinuxino-rt5350f.mk|  20 
 7 files changed, 238 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ramips/dts/OLINUXINO-RT5350F-EVB.dts
 create mode 100644 target/linux/ramips/dts/OLINUXINO-RT5350F.dts
 create mode 100644 target/linux/ramips/rt305x/profiles/olinuxino-rt5350f-evb.mk
 create mode 100644 target/linux/ramips/rt305x/profiles/olinuxino-rt5350f.mk

diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index fd03423..ba50f1e 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -334,6 +334,12 @@ ramips_board_detect() {
*Lenovo Y1S)
name=y1s
;;
+   *OLinuXino-RT5350F)
+name=olinuxino-rt5350f
+;;
+*OLinuXino-RT5350F-EVB)
+name=olinuxino-rt5350f-evb
+;;
*)
name=generic
;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index ba69a89..55ce6c9 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -100,7 +100,9 @@ platform_check_image() {
x8 |\
zbt-wa05 |\
y1 |\
-   y1s)
+   y1s|\
+   olinuxino-rt5350f | \
+   olinuxino-rt5350f-evb) 
[ $magic != 27051956 ]  {
echo Invalid image type.
return 1
diff --git a/target/linux/ramips/dts/OLINUXINO-RT5350F-EVB.dts 
b/target/linux/ramips/dts/OLINUXINO-RT5350F-EVB.dts
new file mode 100644
index 000..a644d4a
--- /dev/null
+++ b/target/linux/ramips/dts/OLINUXINO-RT5350F-EVB.dts
@@ -0,0 +1,101 @@
+/dts-v1/;
+
+/include/ rt5350.dtsi
+
+/ {
+compatible = RT5350F-OLINUXINO, ralink,rt5350-soc;
+model = RT5350F-OLINUXINO;
+
+palmbus@1000 {
+spi@b00 {
+status = okay;
+m25p80@0 {
+#address-cells = 1;
+#size-cells = 1;
+compatible = s25fl064k;
+reg = 0 0;
+linux,modalias = m25p80, s25fl064k;
+spi-max-frequency = 1000;
+
+partition@0 {
+label = u-boot;
+reg = 0x0 0x3;
+read-only;
+};
+
+partition@3 {
+label = u-boot-env;
+reg = 0x3 0x1;
+read-only;
+};
+
+factory: partition@4 {
+label = factory;
+reg = 0x4 0x1;
+read-only;
+};
+
+partition@5 {
+label = firmware;
+reg = 0x5 0x3b;
+};
+};
+};
+gpio1: gpio@660 {
+status = okay;
+};
+};
+
+pinctrl {
+state_default: pinctrl0 {
+gpio {
+ralink,group = jtag, rgmii, mdio, 
uartf;
+ralink,function = gpio;
+};
+};
+};
+
+ethernet@1010 {
+mtd-mac-address = factory 0x4;
+};
+
+esw@1011 {
+ralink,portmap = 0x2f;
+ralink,led_polarity = 0x17;
+};
+
+wmac@1018 {
+ralink,mtd-eeprom = factory 0;
+};
+
+ehci@101c {
+status = okay;
+

Re: [OpenWrt-Devel] Regarding bridge multicast-to-unicast patch

2015-06-03 Thread Steven Barth
Thanks for the quick reply.


On 03.06.2015 08:26, Linus Lüssing wrote:
 For IPv6 and a non-zero IPv4 source address it'll use the normal
 IGMP/MLD querier election mechanism, meaning the one with the lowest
 IP address will become the selected querier and the only one querying
 on the link.
So especially for v6 - since the kernel doesn't do IGMPv3 / MLDv2 - this
effectively downgrades all the bridge links to ASM then (at least with a
50% chance, i.e. when the kernel wins due to lower MAC-address), which
is a bit meh.

Now remaining question is, does the kernel detect if there is a
userspace-querier running on the same machine and silence itself then?
If not we probably need to address this as well somehow.


Cheers,

Steven
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Regarding bridge multicast-to-unicast patch

2015-06-03 Thread Linus Lüssing
On Wed, Jun 03, 2015 at 07:47:49AM +0200, Steven Barth wrote:
 Do you by chance remember what was the behavior of the Linux kernel's
 intenral querier was.
 
 I mean does it use the usual L3-address of the bridge as source?

For IPv4 it uses 0.0.0.0 by default and there's an option to use
the IPv4 address of the interface (multicast_query_use_ifaddr).
For IPv6 it always uses the link-local IPv6 address of the bridge.

 How does it behave in the presence of other queriers either on WiFi stas or
 other bridge ports?

For IPv4 if 0.0.0.0 is used and if it hears any other query it'll
become quiet (and will start querying again if that querier
vanished after a certain timeout).

For IPv6 and a non-zero IPv4 source address it'll use the normal
IGMP/MLD querier election mechanism, meaning the one with the
lowest IP address will become the selected querier and the only
one querying on the link.

If the selected querier is behind one of the bridge ports then
any multicast traffic is always forwarded to that port regardless
of the IGMP/MLD reports it got from there.

Cheers, Linus
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/3] Add TG582N option in profile section of menuconfig

2015-06-03 Thread Kejia Hu (Terry)
From: Kejia Hu kejia...@codethink.co.uk

---
 target/linux/brcm63xx/profiles/thomson.mk | 9 +
 1 file changed, 9 insertions(+)
 create mode 100644 target/linux/brcm63xx/profiles/thomson.mk

diff --git a/target/linux/brcm63xx/profiles/thomson.mk 
b/target/linux/brcm63xx/profiles/thomson.mk
new file mode 100644
index 000..04eca76
--- /dev/null
+++ b/target/linux/brcm63xx/profiles/thomson.mk
@@ -0,0 +1,9 @@
+define Profile/TG582N
+  NAME:=THOMSON TG582N
+  PACKAGES:=kmod-b43 wpad-mini \
+kmod-usb2 kmod-usb-ohci
+endef
+define Profile/A4001N1/Description
+  Package set optimized for TG582N.
+endef
+$(eval $(call Profile,TG582N))
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Add support for Thomson TG582n DANT-1 board

2015-06-03 Thread Kejia Hu (Terry)

Signed-off-by: Kejia Hu kejia...@codethink.co.uk
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 0/3] Add support for Thomson TG582n DANT-1 board

2015-06-03 Thread Kejia Hu (Terry)
From: Kejia Hu kejia...@codethink.co.uk

This set of patches added support for Thomson TG582n DANT-1 board.

They have been tested by building a CFE image, and loaded to the board using
a customised CFE.

support for DANT-T board may be possible with these patches with limited 
modification,
but I can't test this due to lack of hardware.

Kejia Hu (3):
  Add support for EON EN25Q128 flash chip.
  Add support for TG582n DANT-1 board.
  Add TG582N option in profile section of menuconfig

 target/linux/brcm63xx/base-files/lib/brcm63xx.sh   |  3 +
 target/linux/brcm63xx/dts/tg582n.dts   | 81 ++
 target/linux/brcm63xx/image/Makefile   |  2 +
 .../brcm63xx/patches-3.18/571-board_TG582N.patch   | 70 +++
 target/linux/brcm63xx/profiles/thomson.mk  |  9 +++
 ...-spi-nor-add-support-for-the-EON-EN25Q128.patch | 12 
 6 files changed, 177 insertions(+)
 create mode 100644 target/linux/brcm63xx/dts/tg582n.dts
 create mode 100644 target/linux/brcm63xx/patches-3.18/571-board_TG582N.patch
 create mode 100644 target/linux/brcm63xx/profiles/thomson.mk
 create mode 100644 
target/linux/generic/patches-3.18/475-mtd-spi-nor-add-support-for-the-EON-EN25Q128.patch

-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] lldpd: add option to disable custom TLVs

2015-06-03 Thread Alexandru Ardelean
Signed-off-by: Alexandru Ardelean ardeleana...@gmail.com
---
 package/network/services/lldpd/Config.in | 5 +
 package/network/services/lldpd/Makefile  | 1 +
 2 files changed, 6 insertions(+)

diff --git a/package/network/services/lldpd/Config.in 
b/package/network/services/lldpd/Config.in
index 448506d..93d84e2 100644
--- a/package/network/services/lldpd/Config.in
+++ b/package/network/services/lldpd/Config.in
@@ -41,6 +41,11 @@ config LLDPD_WITH_DOT3
prompt Enable Dot3 extension (PHY stuff)
default y
 
+config LLDPD_WITH_CUSTOM
+   bool
+   prompt Enable Custom TLVs
+   default y
+
 config LLDPD_WITH_JSON
bool
prompt Enable JSON output for the LLDP Command-Line Interface
diff --git a/package/network/services/lldpd/Makefile 
b/package/network/services/lldpd/Makefile
index cccb9ba..81e4a8f 100644
--- a/package/network/services/lldpd/Makefile
+++ b/package/network/services/lldpd/Makefile
@@ -100,6 +100,7 @@ CONFIGURE_ARGS += \
$(if $(CONFIG_LLDPD_WITH_LLDPMED),,--disable-lldpmed) \
$(if $(CONFIG_LLDPD_WITH_DOT1),,--disable-dot1) \
$(if $(CONFIG_LLDPD_WITH_DOT3),,--disable-dot3) \
+   $(if $(CONFIG_LLDPD_WITH_CUSTOM),,--disable-custom) \
$(if $(CONFIG_LLDPD_WITH_SONMP),,--disable-sonmp) \
$(if $(CONFIG_LLDPD_WITH_JSON),--with-json=json-c,--with-json=no)
 
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 1/1] ramips: Add support for RT5350F-OLinuXino

2015-06-03 Thread John Crispin
Hi,

there are lots of places where the tabs were replaced with spaces. maybe
your mail client chewed the mail ?

the patch as such is fine though. please fix the whitespace problem and
resend

John

On 03/06/2015 11:49, gamis...@gmail.com wrote:
 From: Dimitar Gamishev HeHoPMaJIeH gamis...@gmail.com
 
  Support for Olimex RT5350F-OLinuXino Boards, tested with RT5350F-OLinuXino 
 and RT5350F-OLinuXino-EVB boards. More Info :
  
 https://www.olimex.com/Products/OLinuXino/RT5350F/RT5350F-OLinuXino/open-source-hardware
 
 Signed-off-by: Dimitar Gamishev HeHoPMaJIeH gamis...@gmail.com
 ---
  target/linux/ramips/base-files/lib/ramips.sh   |   6 ++
  .../ramips/base-files/lib/upgrade/platform.sh  |   4 +-
  target/linux/ramips/dts/OLINUXINO-RT5350F-EVB.dts  | 101 
 +
  target/linux/ramips/dts/OLINUXINO-RT5350F.dts  |  79 
  target/linux/ramips/image/Makefile |   8 ++
  .../rt305x/profiles/olinuxino-rt5350f-evb.mk   |  21 +
  .../ramips/rt305x/profiles/olinuxino-rt5350f.mk|  20 
  7 files changed, 238 insertions(+), 1 deletion(-)
  create mode 100644 target/linux/ramips/dts/OLINUXINO-RT5350F-EVB.dts
  create mode 100644 target/linux/ramips/dts/OLINUXINO-RT5350F.dts
  create mode 100644 
 target/linux/ramips/rt305x/profiles/olinuxino-rt5350f-evb.mk
  create mode 100644 target/linux/ramips/rt305x/profiles/olinuxino-rt5350f.mk
 
 diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
 b/target/linux/ramips/base-files/lib/ramips.sh
 index fd03423..ba50f1e 100755
 --- a/target/linux/ramips/base-files/lib/ramips.sh
 +++ b/target/linux/ramips/base-files/lib/ramips.sh
 @@ -334,6 +334,12 @@ ramips_board_detect() {
   *Lenovo Y1S)
   name=y1s
   ;;
 + *OLinuXino-RT5350F)
 +name=olinuxino-rt5350f
 +;;
 +*OLinuXino-RT5350F-EVB)
 +name=olinuxino-rt5350f-evb
 +;;
   *)
   name=generic
   ;;
 diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
 b/target/linux/ramips/base-files/lib/upgrade/platform.sh
 index ba69a89..55ce6c9 100755
 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
 +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
 @@ -100,7 +100,9 @@ platform_check_image() {
   x8 |\
   zbt-wa05 |\
   y1 |\
 - y1s)
 + y1s|\
 + olinuxino-rt5350f | \
 + olinuxino-rt5350f-evb) 
   [ $magic != 27051956 ]  {
   echo Invalid image type.
   return 1
 diff --git a/target/linux/ramips/dts/OLINUXINO-RT5350F-EVB.dts 
 b/target/linux/ramips/dts/OLINUXINO-RT5350F-EVB.dts
 new file mode 100644
 index 000..a644d4a
 --- /dev/null
 +++ b/target/linux/ramips/dts/OLINUXINO-RT5350F-EVB.dts
 @@ -0,0 +1,101 @@
 +/dts-v1/;
 +
 +/include/ rt5350.dtsi
 +
 +/ {
 +compatible = RT5350F-OLINUXINO, ralink,rt5350-soc;
 +model = RT5350F-OLINUXINO;
 +
 +palmbus@1000 {
 +spi@b00 {
 +status = okay;
 +m25p80@0 {
 +#address-cells = 1;
 +#size-cells = 1;
 +compatible = s25fl064k;
 +reg = 0 0;
 +linux,modalias = m25p80, s25fl064k;
 +spi-max-frequency = 1000;
 +
 +partition@0 {
 +label = u-boot;
 +reg = 0x0 0x3;
 +read-only;
 +};
 +
 +partition@3 {
 +label = u-boot-env;
 +reg = 0x3 0x1;
 +read-only;
 +};
 +
 +factory: partition@4 {
 +label = factory;
 +reg = 0x4 0x1;
 +read-only;
 +};
 +
 +partition@5 {
 +label = firmware;
 +reg = 0x5 0x3b;
 +};
 +};
 +};
 +gpio1: gpio@660 {
 +status = okay;
 +};
 +};
 +
 +pinctrl {
 +state_default: pinctrl0 {
 +gpio {
 +ralink,group = jtag, rgmii, mdio, 
 uartf;
 +ralink,function = gpio;
 +};
 +};
 +};
 +
 +

[OpenWrt-Devel] [PATCH] Add sch_fq and sch_pie to the kmod-sched package.

2015-06-03 Thread Toke Høiland-Jørgensen

These are two new packet schedulers introduced in Linux 3.12 and 3.14
respectively. sch_fq is a perfect fairness queueing scheduler that also
adds pacing on host TCP flows, and sch_pie is an AQM.

Having them available in kmod-sched makes it easier for people to test
these new queueing schemes.

Signed-off-by: Toke Høiland-Jørgensen t...@toke.dk
---
 package/kernel/linux/modules/netsupport.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/kernel/linux/modules/netsupport.mk 
b/package/kernel/linux/modules/netsupport.mk
index 4483581..cead141 100644
--- a/package/kernel/linux/modules/netsupport.mk
+++ b/package/kernel/linux/modules/netsupport.mk
@@ -802,6 +802,8 @@ define KernelPackage/sched
CONFIG_NET_SCH_TBF \
CONFIG_NET_SCH_SFQ \
CONFIG_NET_SCH_TEQL \
+   CONFIG_NET_SCH_FQ \
+   CONFIG_NET_SCH_PIE \
CONFIG_NET_CLS_BASIC \
CONFIG_NET_ACT_POLICE \
CONFIG_NET_ACT_IPT \
-- 
2.4.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/3] Add support for TG582n DANT-1 board.

2015-06-03 Thread Kejia Hu (Terry)
From: Kejia Hu kejia...@codethink.co.uk

The other variant board (DANT-T) of the router may be supported after these 
patches, but
these patches have only been tested on DANT-1 board.
---
 target/linux/brcm63xx/base-files/lib/brcm63xx.sh   |  3 +
 target/linux/brcm63xx/dts/tg582n.dts   | 81 ++
 target/linux/brcm63xx/image/Makefile   |  2 +
 .../brcm63xx/patches-3.18/571-board_TG582N.patch   | 70 +++
 4 files changed, 156 insertions(+)
 create mode 100644 target/linux/brcm63xx/dts/tg582n.dts
 create mode 100644 target/linux/brcm63xx/patches-3.18/571-board_TG582N.patch

diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh 
b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
index 0eb9a75..dd87b9d 100755
--- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
+++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
@@ -231,6 +231,9 @@ brcm63xx_dt_detect() {
TP-Link TD-W8900GB)
board_name=td-w8900gb
;;
+   THOMSON TG582N)
+   board_name=tg582n
+   ;;
USRobotics 9108)
board_name=usr9108
;;
diff --git a/target/linux/brcm63xx/dts/tg582n.dts 
b/target/linux/brcm63xx/dts/tg582n.dts
new file mode 100644
index 000..a6986a7
--- /dev/null
+++ b/target/linux/brcm63xx/dts/tg582n.dts
@@ -0,0 +1,81 @@
+/dts-v1/;
+
+/include/ bcm6328.dtsi
+
+/ {
+   model = TG582N;
+   compatible = thomson,tg582n, brcm,bcm6328;
+
+   gpio-keys-polled {
+   compatible = gpio-keys-polled;
+   #address-cells = 1;
+   #size-cells = 0;
+   poll-interval = 20;
+   debounce-interval = 60;
+
+   reset {
+   label = reset;
+   gpios = gpio0 23 1;
+   linux,code = 0x198;
+   };
+   wps {
+   label = wlan;
+   gpios = gpio0 24 1;
+   linux,code = 0xee;
+   };
+   };
+
+   gpio-leds {
+   compatible = gpio-leds;
+
+   inet_red {
+   label = A4001N1:red:inet;
+   gpios = gpio0 2 1;
+   };
+   ppp_green {
+   label = A4001N1:green:ppp;
+   gpios = gpio0 3 1;
+   };
+   power_green {
+   label = A4001N1:green:power;
+   gpios = gpio0 4 1;
+   default-state = on;
+   };
+   ppp_red {
+   label = A4001N1:red:ppp;
+   gpios = gpio0 5 1;
+   };
+   usb_green {
+   label = A4001N1:green:3g;
+   gpios = gpio0 6 1;
+   };
+   usb_red {
+   label = A4001N1:red:3g;
+   gpios = gpio0 7 1;
+   };
+   power_red {
+   label = A4001N1:red:power;
+   gpios = gpio0 8 1;
+   };
+   wlan_green {
+   label = A4001N1:green:wlan;
+   gpios = gpio0 9 1;
+   };
+   wlan_red {
+   label = A4001N1:red:wlan;
+   gpios = gpio0 10 1;
+   };
+   inet_green {
+   label = A4001N1:green:inet;
+   gpios = gpio0 11 1;
+   };
+   eth_red {
+   label = A4001N1:red:eth;
+   gpios = gpio0 20 1;
+   };
+   eth_green {
+   label = A4001N1:green:eth;
+   gpios = gpio0 31 1;
+   };
+   };
+};
diff --git a/target/linux/brcm63xx/image/Makefile 
b/target/linux/brcm63xx/image/Makefile
index 139a2e3..3e68e98 100755
--- a/target/linux/brcm63xx/image/Makefile
+++ b/target/linux/brcm63xx/image/Makefile
@@ -415,6 +415,8 @@ $(eval $(call 
ImageDTB,CFEDTB,CPVA642,CPA-ZNTE60T,cpva642,CPVA642,6358,--signatu
 $(eval $(call ImageDTB,Dummy,MAGIC,MAGIC,magic,MAGIC,6348))
 # TP-Link TD-W8900GB
 $(eval $(call 
ImageDTB,CFEDTB,TDW8900GB,TD-W8900GB,td-w8900gb,96348GW-11,6348,--rsa-signature 
$(shell printf 'PRID\x89\x10\x00\x02') --image-offset 0x2))
+# Thomsom TG582n
+$(eval $(call ImageDTB,CFEDTB,TG582N,TG582N,tg582n,963281T_TEF,6328,--pad 8))
 # USRobotics 9108
 $(eval $(call ImageDTB,CFEDTB,USR9108,USR9108,usr9108,96348GW-A,6348))
 # ZyXEL P870HW-51a v2
diff --git a/target/linux/brcm63xx/patches-3.18/571-board_TG582N.patch 
b/target/linux/brcm63xx/patches-3.18/571-board_TG582N.patch
new file mode 100644
index 000..005f858
--- /dev/null
+++ b/target/linux/brcm63xx/patches-3.18/571-board_TG582N.patch
@@ -0,0 +1,70 @@
+--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
 

[OpenWrt-Devel] [PATCH 1/3] Add support for EON EN25Q128 flash chip.

2015-06-03 Thread Kejia Hu (Terry)
From: Kejia Hu kejia...@codethink.co.uk

This is part of the work to add support for Thomson TG582n router.

There are 2 variants for the board, namely DANT-T and DANT-1, EN25Q128 is used 
on
DANT-1 only.
---
 .../475-mtd-spi-nor-add-support-for-the-EON-EN25Q128.patch   | 12 
 1 file changed, 12 insertions(+)
 create mode 100644 
target/linux/generic/patches-3.18/475-mtd-spi-nor-add-support-for-the-EON-EN25Q128.patch

diff --git 
a/target/linux/generic/patches-3.18/475-mtd-spi-nor-add-support-for-the-EON-EN25Q128.patch
 
b/target/linux/generic/patches-3.18/475-mtd-spi-nor-add-support-for-the-EON-EN25Q128.patch
new file mode 100644
index 000..7bb550d
--- /dev/null
+++ 
b/target/linux/generic/patches-3.18/475-mtd-spi-nor-add-support-for-the-EON-EN25Q128.patch
@@ -0,0 +1,12 @@
+diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
+index c51ee52..09a1a12 100644
+--- a/drivers/mtd/spi-nor/spi-nor.c
 b/drivers/mtd/spi-nor/spi-nor.c
+@@ -497,6 +497,7 @@ static const struct spi_device_id spi_nor_ids[] = {
+   { en25q32b,   INFO(0x1c3016, 0, 64 * 1024,   64, 0) },
+   { en25p64,INFO(0x1c2017, 0, 64 * 1024,  128, 0) },
+   { en25q64,INFO(0x1c3017, 0, 64 * 1024,  128, SECT_4K) },
++  { en25q128,   INFO(0x1c3018, 0, 64 * 1024,  256, 0) },
+   { en25qh128,  INFO(0x1c7018, 0, 64 * 1024,  256, 0) },
+   { en25qh256,  INFO(0x1c7019, 0, 64 * 1024,  512, 0) },
+ 
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Add sch_fq and sch_pie to the kmod-sched package.

2015-06-03 Thread Etienne Champetier
2015-06-03 18:08 GMT+02:00 Etienne Champetier champetier.etie...@gmail.com
:

 Hi Toke,

 2015-06-03 14:15 GMT+02:00 Toke Høiland-Jørgensen t...@toke.dk:


 These are two new packet schedulers introduced in Linux 3.12 and 3.14
 respectively. sch_fq is a perfect fairness queueing scheduler that also
 adds pacing on host TCP flows, and sch_pie is an AQM.

 Having them available in kmod-sched makes it easier for people to test
 these new queueing schemes.

 Signed-off-by: Toke Høiland-Jørgensen t...@toke.dk
 ---

 what is the size of the image/.ipk with/without this option ?

 reply all is better :)
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ar71xx: fix 100/10mbps ethernet link issues on mynet range extender

2015-06-03 Thread Christian Lamparter
The mynet range extender hardware is suffering from ethernet
link loss when booting with a recent openwrt image. This only
happens on 100mbps links, with 1Gbps speed the link was fine.

The cause of the problem is that the AR8035 PHY (aka F1E)
requires turning on and off the special TX delay setting
depending on the speed of the link.

The 10mbps mode only needed the proper pll value, which was
extracted from the vendor code.

Reported-by: Pascal Paradis
Signed-off-by: Christian Lamparter chunk...@googlemail.com
---
 .../ar71xx/files/arch/mips/ath79/mach-mynet-rext.c | 20 
 ...t-phy-at803x-allow-to-configure-via-pdata.patch | 53 --
 2 files changed, 69 insertions(+), 4 deletions(-)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-rext.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-rext.c
index 02d168e..3d48ca8 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-rext.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-rext.c
@@ -14,6 +14,7 @@
 #include linux/platform_device.h
 #include linux/ath9k_platform.h
 #include linux/ar8216_platform.h
+#include linux/platform_data/phy-at803x.h
 
 #include asm/mach-ath79/ar71xx_regs.h
 
@@ -124,6 +125,21 @@ static struct gpio_keys_button mynet_rext_gpio_keys[] 
__initdata = {
},
 };
 
+static struct at803x_platform_data mynet_rext_at803x_data = {
+   .disable_smarteee = 0,
+   .enable_rgmii_rx_delay = 1,
+   .enable_rgmii_tx_delay = 0,
+   .fixup_rgmii_tx_delay = 1,
+};
+
+static struct mdio_board_info mynet_rext_mdio0_info[] = {
+{
+.bus_id = ag71xx-mdio.0,
+.phy_addr = 4,
+.platform_data = mynet_rext_at803x_data,
+},
+};
+
 static void mynet_rext_get_mac(const char *name, char *mac)
 {
u8 *nvram = (u8 *) KSEG1ADDR(MYNET_REXT_NVRAM_ADDR);
@@ -169,12 +185,16 @@ static void __init mynet_rext_setup(void)
 
ath79_register_mdio(0, 0x0);
 
+   mdiobus_register_board_info(mynet_rext_mdio0_info,
+   ARRAY_SIZE(mynet_rext_mdio0_info));
+
/* LAN */
mynet_rext_get_mac(et0macaddr=, ath79_eth0_data.mac_addr);
 
/* GMAC0 is connected to an external PHY on Port 4 */
ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ath79_eth0_data.phy_mask = BIT(4);
+   ath79_eth0_pll_data.pll_10   = 0x1313; /* athrs_mac.c */
ath79_eth0_pll_data.pll_1000 = 0x0e00; /* athrs_mac.c */
ath79_eth0_data.mii_bus_dev = ath79_mdio0_device.dev;
ath79_register_eth(0);
diff --git 
a/target/linux/ar71xx/patches-3.18/425-net-phy-at803x-allow-to-configure-via-pdata.patch
 
b/target/linux/ar71xx/patches-3.18/425-net-phy-at803x-allow-to-configure-via-pdata.patch
index babc695..d046ede 100644
--- 
a/target/linux/ar71xx/patches-3.18/425-net-phy-at803x-allow-to-configure-via-pdata.patch
+++ 
b/target/linux/ar71xx/patches-3.18/425-net-phy-at803x-allow-to-configure-via-pdata.patch
@@ -32,6 +32,14 @@
  #define AT803X_DEBUG_SYSTEM_MODE_CTRL 0x05
  #define AT803X_DEBUG_RGMII_TX_CLK_DLY BIT(8)
  
+@@ -50,6 +60,7 @@ MODULE_LICENSE(GPL);
+ struct at803x_priv {
+   bool phy_reset:1;
+   struct gpio_desc *gpiod_reset;
++  int prev_speed;
+ };
+ 
+ struct at803x_context {
 @@ -61,6 +71,43 @@ struct at803x_context {
u16 led_control;
  };
@@ -120,16 +128,53 @@
return 0;
  }
  
+@@ -258,6 +334,8 @@ static int at803x_config_intr(struct phy
+ static void at803x_link_change_notify(struct phy_device *phydev)
+ {
+   struct at803x_priv *priv = phydev-priv;
++  struct at803x_platform_data *pdata;
++  pdata = dev_get_platdata(phydev-dev);
+ 
+   /*
+* Conduct a hardware reset for AT8030 every time a link loss is
+@@ -287,6 +365,26 @@ static void at803x_link_change_notify(st
+   } else {
+   priv-phy_reset = false;
+   }
++  }
++  if (pdata-fixup_rgmii_tx_delay 
++  phydev-speed != priv-prev_speed) {
++  switch (phydev-speed) {
++  case SPEED_10:
++  case SPEED_100:
++  at803x_dbg_reg_set(phydev,
++  AT803X_DEBUG_SYSTEM_MODE_CTRL,
++  AT803X_DEBUG_RGMII_TX_CLK_DLY);
++  break;
++  case SPEED_1000:
++  at803x_dbg_reg_clr(phydev,
++  AT803X_DEBUG_SYSTEM_MODE_CTRL,
++  AT803X_DEBUG_RGMII_TX_CLK_DLY);
++  break;
++  default:
++  break;
++  }
++
++  priv-prev_speed = phydev-speed;
+   }
+ }
+ 
 --- /dev/null
 +++ b/include/linux/platform_data/phy-at803x.h
-@@ -0,0 +1,10 @@
+@@ -0,0 +1,11 @@
 +#ifndef _PHY_AT803X_PDATA_H
 +#define _PHY_AT803X_PDATA_H
 +
 +struct at803x_platform_data {
-+   int disable_smarteee:1;
-+   

Re: [OpenWrt-Devel] Regarding bridge multicast-to-unicast patch

2015-06-03 Thread Linus Lüssing
On Wed, Jun 03, 2015 at 09:56:41AM +0200, Hans Dedecker wrote:
 On Wed, Jun 3, 2015 at 8:50 AM, Steven Barth cy...@openwrt.org wrote:
  Thanks for the quick reply.
 
 
  On 03.06.2015 08:26, Linus Lüssing wrote:
  For IPv6 and a non-zero IPv4 source address it'll use the normal
  IGMP/MLD querier election mechanism, meaning the one with the lowest
  IP address will become the selected querier and the only one querying
  on the link.
  So especially for v6 - since the kernel doesn't do IGMPv3 / MLDv2 - this
  effectively downgrades all the bridge links to ASM then (at least with a
  50% chance, i.e. when the kernel wins due to lower MAC-address), which
  is a bit meh.

Right, that's currently a trade-off, if you don't have
source-specific-multicast or another MLD querier on the network,
it is nice to have it enabled by default. Otherwise there's a
disadvantage. Not sure how often source-specific-multicast is actually
used these days and what the philosophy and typical scenario for the
default values in OpenWRT is. If the defaults were optimized for the
average guys home router, who probably doesn't have an SSM multicast
router, but might have an app to do some multicast music/video/conference
streaming it should probably be enabled by default to avoid his
wifi becoming unusable/congested. Don't feel strongly about the default
for the querier though.

 
  Now remaining question is, does the kernel detect if there is a
  userspace-querier running on the same machine and silence itself then?
  If not we probably need to address this as well somehow.
 I can confirm the bridge querier silence itself when an
 userspace-querier is running at least for IGMP.
 Did not check the MLD behavior yet.

Yes, that's probably due to the bridge zero-source querier becoming
quiet when it hears another IGMP query. For MLD that should be different
yes.

Steven, could you elaborate a little more on the scenario and
explain why it is a must to shut up automatically when having a
local user-space querier? If people are able to manually install and
configure a complex multicast router, aren't they capable of
manually disabling the bridge querier, too (there's even a netifd
option for that)?

Cheers, Linus
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Regarding bridge multicast-to-unicast patch

2015-06-03 Thread Steven Barth



Steven, could you elaborate a little more on the scenario and
explain why it is a must to shut up automatically when having a
local user-space querier? If people are able to manually install and
configure a complex multicast router, aren't they capable of
manually disabling the bridge querier, too (there's even a netifd
option for that)?

I'm not thinking about complex router setups but instead about simple SSM 
capable proxies (i.e. mcproxy and the like). I think thats a valid point and 
don't see why v6 behaves rather awkwardly compared to v4 which simply goes 
silent. If i run a userspace querier the kernel should shut up otherwise the 
userspace querier might get utterly confused since its suddenly competing 
against itself in the election.

I mean the kernel can still do the mc- uc translation but simply let userspace 
do the querying. Though i guess if all else fails we need to do this manually 
using /proc writes in the init script hmmm...
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel