Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On Sat, 2012-12-08 at 15:06 +0100, Felix Fietkau wrote: > >> The proper long term solution is to make sure that the kernel does the > >> right thing and doesn't require userspace fixup for these devices. >> > > As per previous discussion, this just isn't going to happen on lantiq. > > Well, doing a userspace fixup is a hack and no amount of dressing it up > to appear clean will change that. It's a hack wherever we do it. The "proper" solution is for the Ethernet devices (and ATM devices) to have their own EEPROM or whatever which stores their MAC/ESI, and for the device driver to pick it up directly as $DEITY intended. But populating each device with its own EEPROM adds to the BOM, so it's entirely understandable that they *don't* do this, and they add it into the system flash. But it means that we end up with a system-wide hack necessary to get that information from the system flash storage into the device/driver somehow. Doing this in the kernel requires hacking each and every driver on affects boards, to pick its MAC address up from some special place which may differ from platform to platform. It's painful, and any kernel hacker is likely to suggest quite strongly that it *doesn't* live in the kernel. The kernel provides an API for userspace to set the MAC/ESI on Ethernet and ATM devices, and userspace already *has* stuff in place to support that and to override the MAC in cases where the device's own one isn't sufficient for some reason. To me, it doesn't seem to make much sense *not* to use/extend that existing setup. I really don't want to see this done in the kernel. It lives in userspace. -- dwmw2 smime.p7s Description: S/MIME cryptographic signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On Sat, 2012-12-08 at 15:06 +0100, Felix Fietkau wrote: > On 2012-12-08 2:51 PM, Daniel Gimpelevich wrote: > > On Sat, 2012-12-08 at 14:44 +0100, Felix Fietkau wrote: > >> As for the time when hotplug is running wrt. loaded modules - normally > >> udevtrigger should take care of generating the right events. > > > > Modules are loaded before any of this is possible, in /etc/init.d/boot > > as currently written. > udevtrigger is called after modules are loaded, because it's supposed to > generate events for any device present at this point. Well, it sure doesn't seem to be doing that for anything in /etc/hotplug.d/atm now. > >> The proper long term solution is to make sure that the kernel does the > >> right thing and doesn't require userspace fixup for these devices. > > As per previous discussion, this just isn't going to happen on lantiq. > Well, doing a userspace fixup is a hack and no amount of dressing it up > to appear clean will change that. There's really no need to make this > look clean, just do a very simple platform specific hack that works, and > leave it in until it's replaced by a proper solution. > This trivial issue has already wasted way more time than it deserves... > > - Felix I agree with every word of that, especially about wasting time. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On 2012-12-08 2:51 PM, Daniel Gimpelevich wrote: > On Sat, 2012-12-08 at 14:44 +0100, Felix Fietkau wrote: >> As for the time when hotplug is running wrt. loaded modules - normally >> udevtrigger should take care of generating the right events. > > Modules are loaded before any of this is possible, in /etc/init.d/boot > as currently written. udevtrigger is called after modules are loaded, because it's supposed to generate events for any device present at this point. >> The proper long term solution is to make sure that the kernel does the >> right thing and doesn't require userspace fixup for these devices. > As per previous discussion, this just isn't going to happen on lantiq. Well, doing a userspace fixup is a hack and no amount of dressing it up to appear clean will change that. There's really no need to make this look clean, just do a very simple platform specific hack that works, and leave it in until it's replaced by a proper solution. This trivial issue has already wasted way more time than it deserves... - Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On Sat, 2012-12-08 at 14:44 +0100, Felix Fietkau wrote: > As for the time when hotplug is running wrt. loaded modules - normally > udevtrigger should take care of generating the right events. Modules are loaded before any of this is possible, in /etc/init.d/boot as currently written. > I was suggesting this as a hack rather than a proper fix. I don't see > any of the script based MAC address override approaches as a long term > solution. Miscommunication, my bad. > The proper long term solution is to make sure that the kernel does the > right thing and doesn't require userspace fixup for these devices. > > - Felix > As per previous discussion, this just isn't going to happen on lantiq. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On 2012-12-08 2:34 PM, Daniel Gimpelevich wrote: > On Sat, 2012-12-08 at 10:49 +, David Woodhouse wrote: >> On Fri, 2012-12-07 at 18:58 -0800, Daniel Gimpelevich wrote: >> > > > OK, but hotplug never generates any atm events, so Felix suggested this >> > > > instead. >> > > >> > > Hm, it should do. We have other scripts in /etc/hotplug.d/atm, and >> > > hotplug2.rules definitely *looks* like it should be invoking them. >> > > >> > >> > There is only one such script, and you should make sure it still >> > works, because I put one in to test, and it was never executed. >> >> That needs fixing then. Don't just do things wrongly to work around a >> bug elsewhere — *fix* the bug. I may be able to take a look at this in a >> few days' time, once my Geos is up and running again. >> >> Bad Felix, if he really advised you to use an initscript and he meant it >> as a long-term thing rather than a temporary hack for testing the >> concept. >> > > Does solos-pci add the sysfs entri(es) when the module is inserted, or > later? Modules are inserted before hotplug is running, so if solos-pci > does not add at that time, that could account for the discrepancy. I > would have assumed Felix knew hotplug wasn't running yet when he > suggested this. As for the time when hotplug is running wrt. loaded modules - normally udevtrigger should take care of generating the right events. I was suggesting this as a hack rather than a proper fix. I don't see any of the script based MAC address override approaches as a long term solution. The proper long term solution is to make sure that the kernel does the right thing and doesn't require userspace fixup for these devices. - Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On Sat, 2012-12-08 at 10:49 +, David Woodhouse wrote: > On Fri, 2012-12-07 at 18:58 -0800, Daniel Gimpelevich wrote: > > > > OK, but hotplug never generates any atm events, so Felix suggested this > > > > instead. > > > > > > Hm, it should do. We have other scripts in /etc/hotplug.d/atm, and > > > hotplug2.rules definitely *looks* like it should be invoking them. > > > > > > > There is only one such script, and you should make sure it still > > works, because I put one in to test, and it was never executed. > > That needs fixing then. Don't just do things wrongly to work around a > bug elsewhere — *fix* the bug. I may be able to take a look at this in a > few days' time, once my Geos is up and running again. > > Bad Felix, if he really advised you to use an initscript and he meant it > as a long-term thing rather than a temporary hack for testing the > concept. > Does solos-pci add the sysfs entri(es) when the module is inserted, or later? Modules are inserted before hotplug is running, so if solos-pci does not add at that time, that could account for the discrepancy. I would have assumed Felix knew hotplug wasn't running yet when he suggested this. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On Fri, 2012-12-07 at 18:58 -0800, Daniel Gimpelevich wrote: > > > OK, but hotplug never generates any atm events, so Felix suggested this > > > instead. > > > > Hm, it should do. We have other scripts in /etc/hotplug.d/atm, and > > hotplug2.rules definitely *looks* like it should be invoking them. > > > > There is only one such script, and you should make sure it still > works, because I put one in to test, and it was never executed. That needs fixing then. Don't just do things wrongly to work around a bug elsewhere — *fix* the bug. I may be able to take a look at this in a few days' time, once my Geos is up and running again. Bad Felix, if he really advised you to use an initscript and he meant it as a long-term thing rather than a temporary hack for testing the concept. -- dwmw2 smime.p7s Description: S/MIME cryptographic signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On Fri, 2012-12-07 at 22:12 +, David Woodhouse wrote: > On Fri, 2012-12-07 at 12:59 -0800, Daniel Gimpelevich wrote: > > > It'd be better to put that in /etc/hotplug.d/atm so that you don't have > > > to worry about the timing of when the atm driver loads at startup, and > > > it gets done properly if the driver is ever unloaded and reloaded, etc. > > > > > > > OK, but hotplug never generates any atm events, so Felix suggested this > > instead. > > Hm, it should do. We have other scripts in /etc/hotplug.d/atm, and > hotplug2.rules definitely *looks* like it should be invoking them. > There is only one such script, and you should make sure it still works, because I put one in to test, and it was never executed. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On Fri, 2012-12-07 at 12:59 -0800, Daniel Gimpelevich wrote: > > It'd be better to put that in /etc/hotplug.d/atm so that you don't have > > to worry about the timing of when the atm driver loads at startup, and > > it gets done properly if the driver is ever unloaded and reloaded, etc. > > > > OK, but hotplug never generates any atm events, so Felix suggested this > instead. Hm, it should do. We have other scripts in /etc/hotplug.d/atm, and hotplug2.rules definitely *looks* like it should be invoking them. -- dwmw2 smime.p7s Description: S/MIME cryptographic signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On Fri, 2012-12-07 at 12:59 -0800, Daniel Gimpelevich wrote: > On Fri, 2012-12-07 at 20:56 +, David Woodhouse wrote: > > On Fri, 2012-12-07 at 12:34 -0800, Daniel Gimpelevich wrote: > > > Index: target/linux/lantiq/base-files/etc/init.d/ifx-esi > > > === > > > --- target/linux/lantiq/base-files/etc/init.d/ifx-esi (revision 0) > > > +++ target/linux/lantiq/base-files/etc/init.d/ifx-esi (revision 0) > > > @@ -0,0 +1,11 @@ > > > +#!/bin/sh /etc/rc.common > > > + > > > +START=15 > > > + > > > +start() { > > > + ethmac=`xargs -n 1 echo < /proc/cmdline | grep '^ethaddr=' | sed > > > -e 's,ethaddr=,,' -e 's,:,,g'` > > > + atmmac=`echo $ethmac | sed 's,..$,,'`$(printf '%06x' > > > $((1+0x`echo $ethmac | sed 's,^..,,'`)) | sed 's,.*\(..\)$,\1,') > > > + for atmdev in `ls /sys/class/atm`; do > > > + esi $atmmac `echo $atmdev | sed 's,[^0-9]*\(.*\)$,\1,'` > > > + done > > > +} > > > > It'd be better to put that in /etc/hotplug.d/atm so that you don't have > > to worry about the timing of when the atm driver loads at startup, and > > it gets done properly if the driver is ever unloaded and reloaded, etc. > > > > OK, but hotplug never generates any atm events, so Felix suggested this > instead. Sorry, final try: (John, feel free to adjust for 3.7 as you see fit.) Signed-off-by: Daniel Gimpelevich Index: target/linux/lantiq/vr9/target.mk === --- target/linux/lantiq/vr9/target.mk (revision 34577) +++ target/linux/lantiq/vr9/target.mk (working copy) @@ -3,7 +3,7 @@ BOARDNAME:=VR9 FEATURES:=squashfs jffs2 atm -DEFAULT_PACKAGES+=kmod-pppoa ppp-mod-pppoa linux-atm atm-tools br2684ctl kmod-ltq-dsl-vr9 ltq-dsl-app swconfig +DEFAULT_PACKAGES+=kmod-pppoa ppp-mod-pppoa linux-atm atm-esi atm-tools br2684ctl kmod-ltq-dsl-vr9 ltq-dsl-app swconfig define Target/Description Lantiq VR9 Index: target/linux/lantiq/image/Makefile === --- target/linux/lantiq/image/Makefile (revision 34577) +++ target/linux/lantiq/image/Makefile (working copy) @@ -154,7 +154,7 @@ ifeq ($(CONFIG_TARGET_lantiq_ar9),y) Image/BuildKernel/Profile/WBMR=$(call Image/BuildKernel/Template,WBMR,$(xway_cmdline)) -Image/BuildKernel/Profile/DGN3500B=$(call Image/BuildKernel/Template,DGN3500B,$(xway_cmdline)) +Image/BuildKernel/Profile/DGN3500B=$(call Image/BuildKernel/Template,DGN3500B,$(sx76x_cmdline)) Image/BuildKernel/Profile/P2601HNFX=$(call Image/BuildKernel/Template,P2601HNFX,$(xway_cmdline)) Image/BuildKernel/Profile/H201L=$(call Image/BuildKernel/Template,H201L,$(xway_cmdline)) Image/BuildKernel/Profile/FRITZ7320=$(call Image/BuildKernelEVA/Template,FRITZ7320,$(xway_cmdline)) Index: target/linux/lantiq/ar9/target.mk === --- target/linux/lantiq/ar9/target.mk (revision 34577) +++ target/linux/lantiq/ar9/target.mk (working copy) @@ -3,7 +3,7 @@ BOARDNAME:=AR9 FEATURES:=squashfs jffs2 atm -DEFAULT_PACKAGES+=kmod-pppoa ppp-mod-pppoa linux-atm atm-tools br2684ctl kmod-ltq-dsl-ar9 ltq-dsl-app \ +DEFAULT_PACKAGES+=kmod-pppoa ppp-mod-pppoa linux-atm atm-esi atm-tools br2684ctl kmod-ltq-dsl-ar9 ltq-dsl-app \ kmod-input-gpio-keys-polled kmod-ledtrig-netdev kmod-leds-gpio kmod-button-hotplug \ swconfig Index: target/linux/lantiq/danube/target.mk === --- target/linux/lantiq/danube/target.mk(revision 34577) +++ target/linux/lantiq/danube/target.mk(working copy) @@ -3,7 +3,7 @@ BOARDNAME:=Danube FEATURES:=squashfs jffs2 atm -DEFAULT_PACKAGES+=kmod-pppoa ppp-mod-pppoa linux-atm atm-tools br2684ctl kmod-ltq-dsl-danube ltq-dsl-app \ +DEFAULT_PACKAGES+=kmod-pppoa ppp-mod-pppoa linux-atm atm-esi atm-tools br2684ctl kmod-ltq-dsl-danube ltq-dsl-app \ kmod-input-gpio-keys-polled kmod-ledtrig-netdev kmod-leds-gpio kmod-button-hotplug \ swconfig Index: target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-netgear.c === --- target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-netgear.c (revision 34577) +++ target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-netgear.c (working copy) @@ -77,8 +77,8 @@ static struct gpio_led dgn3500_gpio_leds[] __initdata = { - { .name = "soc:green:power", .gpio = 34, .active_low = 1, }, - { .name = "soc:red:power", .gpio = 39, .active_low = 1, }, + { .name = "soc:green:power", .gpio = 34, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:red:power", .gpio = 39, .active_low = 1, .default_trigger = "default-on" }, { .name = "soc:orange:wlan", .gpio = 51, .active_low = 1, }, { .name = "soc:green:wps", .gpio = 52, .active_low = 1, },
Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On Fri, 2012-12-07 at 20:56 +, David Woodhouse wrote: > On Fri, 2012-12-07 at 12:34 -0800, Daniel Gimpelevich wrote: > > Index: target/linux/lantiq/base-files/etc/init.d/ifx-esi > > === > > --- target/linux/lantiq/base-files/etc/init.d/ifx-esi (revision 0) > > +++ target/linux/lantiq/base-files/etc/init.d/ifx-esi (revision 0) > > @@ -0,0 +1,11 @@ > > +#!/bin/sh /etc/rc.common > > + > > +START=15 > > + > > +start() { > > + ethmac=`xargs -n 1 echo < /proc/cmdline | grep '^ethaddr=' | sed -e > > 's,ethaddr=,,' -e 's,:,,g'` > > + atmmac=`echo $ethmac | sed 's,..$,,'`$(printf '%06x' > > $((1+0x`echo $ethmac | sed 's,^..,,'`)) | sed 's,.*\(..\)$,\1,') > > + for atmdev in `ls /sys/class/atm`; do > > + esi $atmmac `echo $atmdev | sed 's,[^0-9]*\(.*\)$,\1,'` > > + done > > +} > > It'd be better to put that in /etc/hotplug.d/atm so that you don't have > to worry about the timing of when the atm driver loads at startup, and > it gets done properly if the driver is ever unloaded and reloaded, etc. > OK, but hotplug never generates any atm events, so Felix suggested this instead. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On Fri, 2012-12-07 at 12:34 -0800, Daniel Gimpelevich wrote: > Index: target/linux/lantiq/base-files/etc/init.d/ifx-esi > === > --- target/linux/lantiq/base-files/etc/init.d/ifx-esi (revision 0) > +++ target/linux/lantiq/base-files/etc/init.d/ifx-esi (revision 0) > @@ -0,0 +1,11 @@ > +#!/bin/sh /etc/rc.common > + > +START=15 > + > +start() { > + ethmac=`xargs -n 1 echo < /proc/cmdline | grep '^ethaddr=' | sed -e > 's,ethaddr=,,' -e 's,:,,g'` > + atmmac=`echo $ethmac | sed 's,..$,,'`$(printf '%06x' $((1+0x`echo > $ethmac | sed 's,^..,,'`)) | sed 's,.*\(..\)$,\1,') > + for atmdev in `ls /sys/class/atm`; do > + esi $atmmac `echo $atmdev | sed 's,[^0-9]*\(.*\)$,\1,'` > + done > +} It'd be better to put that in /etc/hotplug.d/atm so that you don't have to worry about the timing of when the atm driver loads at startup, and it gets done properly if the driver is ever unloaded and reloaded, etc. -- dwmw2 smime.p7s Description: S/MIME cryptographic signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On Fri, 2012-12-07 at 12:24 -0800, Daniel Gimpelevich wrote: > On Fri, 2012-12-07 at 12:15 -0800, Daniel Gimpelevich wrote: > > On Thu, 2012-11-29 at 07:40 -0800, Daniel Gimpelevich wrote: > > > On Thu, 2012-11-29 at 10:35 +, Conor O'Gorman wrote: > > > > I don't want to drag this out longer than necessary. You used the phrase > > > > 'hack'. What do you think is the preferred solution? > > > > > > If I had a better one, I would have used it. RFC, again. > > > > Well, here's a better one; take 2: > > Whoops; minor oversight. This is the patch as it should be: Third time's a charm: Signed-off-by: Daniel Gimpelevich Index: target/linux/lantiq/vr9/target.mk === --- target/linux/lantiq/vr9/target.mk (revision 34577) +++ target/linux/lantiq/vr9/target.mk (working copy) @@ -3,7 +3,7 @@ BOARDNAME:=VR9 FEATURES:=squashfs jffs2 atm -DEFAULT_PACKAGES+=kmod-pppoa ppp-mod-pppoa linux-atm atm-tools br2684ctl kmod-ltq-dsl-vr9 ltq-dsl-app swconfig +DEFAULT_PACKAGES+=kmod-pppoa ppp-mod-pppoa linux-atm atm-esi atm-tools br2684ctl kmod-ltq-dsl-vr9 ltq-dsl-app swconfig define Target/Description Lantiq VR9 Index: target/linux/lantiq/image/Makefile === --- target/linux/lantiq/image/Makefile (revision 34577) +++ target/linux/lantiq/image/Makefile (working copy) @@ -154,7 +154,7 @@ ifeq ($(CONFIG_TARGET_lantiq_ar9),y) Image/BuildKernel/Profile/WBMR=$(call Image/BuildKernel/Template,WBMR,$(xway_cmdline)) -Image/BuildKernel/Profile/DGN3500B=$(call Image/BuildKernel/Template,DGN3500B,$(xway_cmdline)) +Image/BuildKernel/Profile/DGN3500B=$(call Image/BuildKernel/Template,DGN3500B,$(sx76x_cmdline)) Image/BuildKernel/Profile/P2601HNFX=$(call Image/BuildKernel/Template,P2601HNFX,$(xway_cmdline)) Image/BuildKernel/Profile/H201L=$(call Image/BuildKernel/Template,H201L,$(xway_cmdline)) Image/BuildKernel/Profile/FRITZ7320=$(call Image/BuildKernelEVA/Template,FRITZ7320,$(xway_cmdline)) Index: target/linux/lantiq/ar9/target.mk === --- target/linux/lantiq/ar9/target.mk (revision 34577) +++ target/linux/lantiq/ar9/target.mk (working copy) @@ -3,7 +3,7 @@ BOARDNAME:=AR9 FEATURES:=squashfs jffs2 atm -DEFAULT_PACKAGES+=kmod-pppoa ppp-mod-pppoa linux-atm atm-tools br2684ctl kmod-ltq-dsl-ar9 ltq-dsl-app \ +DEFAULT_PACKAGES+=kmod-pppoa ppp-mod-pppoa linux-atm atm-esi atm-tools br2684ctl kmod-ltq-dsl-ar9 ltq-dsl-app \ kmod-input-gpio-keys-polled kmod-ledtrig-netdev kmod-leds-gpio kmod-button-hotplug \ swconfig Index: target/linux/lantiq/danube/target.mk === --- target/linux/lantiq/danube/target.mk(revision 34577) +++ target/linux/lantiq/danube/target.mk(working copy) @@ -3,7 +3,7 @@ BOARDNAME:=Danube FEATURES:=squashfs jffs2 atm -DEFAULT_PACKAGES+=kmod-pppoa ppp-mod-pppoa linux-atm atm-tools br2684ctl kmod-ltq-dsl-danube ltq-dsl-app \ +DEFAULT_PACKAGES+=kmod-pppoa ppp-mod-pppoa linux-atm atm-esi atm-tools br2684ctl kmod-ltq-dsl-danube ltq-dsl-app \ kmod-input-gpio-keys-polled kmod-ledtrig-netdev kmod-leds-gpio kmod-button-hotplug \ swconfig Index: target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-netgear.c === --- target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-netgear.c (revision 34577) +++ target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-netgear.c (working copy) @@ -77,8 +77,8 @@ static struct gpio_led dgn3500_gpio_leds[] __initdata = { - { .name = "soc:green:power", .gpio = 34, .active_low = 1, }, - { .name = "soc:red:power", .gpio = 39, .active_low = 1, }, + { .name = "soc:green:power", .gpio = 34, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:red:power", .gpio = 39, .active_low = 1, .default_trigger = "default-on" }, { .name = "soc:orange:wlan", .gpio = 51, .active_low = 1, }, { .name = "soc:green:wps", .gpio = 52, .active_low = 1, }, { .name = "soc:green:usb", .gpio = 22, .active_low = 1, }, @@ -91,7 +91,7 @@ { .desc = "wps", .type = EV_KEY, - .code = BTN_0, + .code = KEY_WPS_BUTTON, .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL, .gpio = 54, .active_low = 1, @@ -99,8 +99,16 @@ { .desc = "reset", .type = EV_KEY, - .code = BTN_1, + .code = BTN_0, .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL, + .gpio = 53, + .active_low = 1, + }, + { + .desc = "rfkill", + .type = EV_KEY, + .code = KEY_RFKILL, + .debounce_interval = LTQ
Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On Fri, 2012-12-07 at 12:15 -0800, Daniel Gimpelevich wrote: > On Thu, 2012-11-29 at 07:40 -0800, Daniel Gimpelevich wrote: > > On Thu, 2012-11-29 at 10:35 +, Conor O'Gorman wrote: > > > I don't want to drag this out longer than necessary. You used the phrase > > > 'hack'. What do you think is the preferred solution? > > > > If I had a better one, I would have used it. RFC, again. > > Well, here's a better one; take 2: Whoops; minor oversight. This is the patch as it should be: Signed-off-by: Daniel Gimpelevich Index: target/linux/lantiq/vr9/target.mk === --- target/linux/lantiq/vr9/target.mk (revision 34577) +++ target/linux/lantiq/vr9/target.mk (working copy) @@ -3,7 +3,7 @@ BOARDNAME:=VR9 FEATURES:=squashfs jffs2 atm -DEFAULT_PACKAGES+=kmod-pppoa ppp-mod-pppoa linux-atm atm-tools br2684ctl kmod-ltq-dsl-vr9 ltq-dsl-app swconfig +DEFAULT_PACKAGES+=kmod-pppoa ppp-mod-pppoa linux-atm atm-esi atm-tools br2684ctl kmod-ltq-dsl-vr9 ltq-dsl-app swconfig define Target/Description Lantiq VR9 Index: target/linux/lantiq/image/Makefile === --- target/linux/lantiq/image/Makefile (revision 34577) +++ target/linux/lantiq/image/Makefile (working copy) @@ -154,7 +154,7 @@ ifeq ($(CONFIG_TARGET_lantiq_ar9),y) Image/BuildKernel/Profile/WBMR=$(call Image/BuildKernel/Template,WBMR,$(xway_cmdline)) -Image/BuildKernel/Profile/DGN3500B=$(call Image/BuildKernel/Template,DGN3500B,$(xway_cmdline)) +Image/BuildKernel/Profile/DGN3500B=$(call Image/BuildKernel/Template,DGN3500B,$(sx76x_cmdline)) Image/BuildKernel/Profile/P2601HNFX=$(call Image/BuildKernel/Template,P2601HNFX,$(xway_cmdline)) Image/BuildKernel/Profile/H201L=$(call Image/BuildKernel/Template,H201L,$(xway_cmdline)) Image/BuildKernel/Profile/FRITZ7320=$(call Image/BuildKernelEVA/Template,FRITZ7320,$(xway_cmdline)) Index: target/linux/lantiq/ar9/target.mk === --- target/linux/lantiq/ar9/target.mk (revision 34577) +++ target/linux/lantiq/ar9/target.mk (working copy) @@ -3,7 +3,7 @@ BOARDNAME:=AR9 FEATURES:=squashfs jffs2 atm -DEFAULT_PACKAGES+=kmod-pppoa ppp-mod-pppoa linux-atm atm-tools br2684ctl kmod-ltq-dsl-ar9 ltq-dsl-app \ +DEFAULT_PACKAGES+=kmod-pppoa ppp-mod-pppoa linux-atm atm-esi atm-tools br2684ctl kmod-ltq-dsl-ar9 ltq-dsl-app \ kmod-input-gpio-keys-polled kmod-ledtrig-netdev kmod-leds-gpio kmod-button-hotplug \ swconfig Index: target/linux/lantiq/danube/target.mk === --- target/linux/lantiq/danube/target.mk(revision 34577) +++ target/linux/lantiq/danube/target.mk(working copy) @@ -3,7 +3,7 @@ BOARDNAME:=Danube FEATURES:=squashfs jffs2 atm -DEFAULT_PACKAGES+=kmod-pppoa ppp-mod-pppoa linux-atm atm-tools br2684ctl kmod-ltq-dsl-danube ltq-dsl-app \ +DEFAULT_PACKAGES+=kmod-pppoa ppp-mod-pppoa linux-atm atm-esi atm-tools br2684ctl kmod-ltq-dsl-danube ltq-dsl-app \ kmod-input-gpio-keys-polled kmod-ledtrig-netdev kmod-leds-gpio kmod-button-hotplug \ swconfig Index: target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-netgear.c === --- target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-netgear.c (revision 34577) +++ target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-netgear.c (working copy) @@ -77,8 +77,8 @@ static struct gpio_led dgn3500_gpio_leds[] __initdata = { - { .name = "soc:green:power", .gpio = 34, .active_low = 1, }, - { .name = "soc:red:power", .gpio = 39, .active_low = 1, }, + { .name = "soc:green:power", .gpio = 34, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:red:power", .gpio = 39, .active_low = 1, .default_trigger = "default-on" }, { .name = "soc:orange:wlan", .gpio = 51, .active_low = 1, }, { .name = "soc:green:wps", .gpio = 52, .active_low = 1, }, { .name = "soc:green:usb", .gpio = 22, .active_low = 1, }, @@ -91,7 +91,7 @@ { .desc = "wps", .type = EV_KEY, - .code = BTN_0, + .code = KEY_WPS_BUTTON, .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL, .gpio = 54, .active_low = 1, @@ -99,8 +99,16 @@ { .desc = "reset", .type = EV_KEY, - .code = BTN_1, + .code = BTN_0, .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL, + .gpio = 53, + .active_low = 1, + }, + { + .desc = "rfkill", + .type = EV_KEY, + .code = KEY_RFKILL, + .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL, .gpio = 36, .active_low = 1, }, @@ -253,5 +
Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On Thu, 2012-11-29 at 07:40 -0800, Daniel Gimpelevich wrote: > On Thu, 2012-11-29 at 10:35 +, Conor O'Gorman wrote: > > I don't want to drag this out longer than necessary. You used the phrase > > 'hack'. What do you think is the preferred solution? > > If I had a better one, I would have used it. RFC, again. Well, here's a better one; take 2: Signed-off-by: Daniel Gimpelevich Index: target/linux/lantiq/vr9/target.mk === --- target/linux/lantiq/vr9/target.mk (revision 34577) +++ target/linux/lantiq/vr9/target.mk (working copy) @@ -3,7 +3,7 @@ BOARDNAME:=VR9 FEATURES:=squashfs jffs2 atm -DEFAULT_PACKAGES+=kmod-pppoa ppp-mod-pppoa linux-atm atm-tools br2684ctl kmod-ltq-dsl-vr9 ltq-dsl-app swconfig +DEFAULT_PACKAGES+=kmod-pppoa ppp-mod-pppoa linux-atm atm-esi atm-tools br2684ctl kmod-ltq-dsl-vr9 ltq-dsl-app swconfig define Target/Description Lantiq VR9 Index: target/linux/lantiq/image/Makefile === --- target/linux/lantiq/image/Makefile (revision 34577) +++ target/linux/lantiq/image/Makefile (working copy) @@ -154,7 +154,7 @@ ifeq ($(CONFIG_TARGET_lantiq_ar9),y) Image/BuildKernel/Profile/WBMR=$(call Image/BuildKernel/Template,WBMR,$(xway_cmdline)) -Image/BuildKernel/Profile/DGN3500B=$(call Image/BuildKernel/Template,DGN3500B,$(xway_cmdline)) +Image/BuildKernel/Profile/DGN3500B=$(call Image/BuildKernel/Template,DGN3500B,$(sx76x_cmdline)) Image/BuildKernel/Profile/P2601HNFX=$(call Image/BuildKernel/Template,P2601HNFX,$(xway_cmdline)) Image/BuildKernel/Profile/H201L=$(call Image/BuildKernel/Template,H201L,$(xway_cmdline)) Image/BuildKernel/Profile/FRITZ7320=$(call Image/BuildKernelEVA/Template,FRITZ7320,$(xway_cmdline)) Index: target/linux/lantiq/ar9/target.mk === --- target/linux/lantiq/ar9/target.mk (revision 34577) +++ target/linux/lantiq/ar9/target.mk (working copy) @@ -3,7 +3,7 @@ BOARDNAME:=AR9 FEATURES:=squashfs jffs2 atm -DEFAULT_PACKAGES+=kmod-pppoa ppp-mod-pppoa linux-atm atm-tools br2684ctl kmod-ltq-dsl-ar9 ltq-dsl-app \ +DEFAULT_PACKAGES+=kmod-pppoa ppp-mod-pppoa linux-atm atm-esi atm-tools br2684ctl kmod-ltq-dsl-ar9 ltq-dsl-app \ kmod-input-gpio-keys-polled kmod-ledtrig-netdev kmod-leds-gpio kmod-button-hotplug \ swconfig Index: target/linux/lantiq/danube/target.mk === --- target/linux/lantiq/danube/target.mk(revision 34577) +++ target/linux/lantiq/danube/target.mk(working copy) @@ -3,7 +3,7 @@ BOARDNAME:=Danube FEATURES:=squashfs jffs2 atm -DEFAULT_PACKAGES+=kmod-pppoa ppp-mod-pppoa linux-atm atm-tools br2684ctl kmod-ltq-dsl-danube ltq-dsl-app \ +DEFAULT_PACKAGES+=kmod-pppoa ppp-mod-pppoa linux-atm atm-esi atm-tools br2684ctl kmod-ltq-dsl-danube ltq-dsl-app \ kmod-input-gpio-keys-polled kmod-ledtrig-netdev kmod-leds-gpio kmod-button-hotplug \ swconfig Index: target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-netgear.c === --- target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-netgear.c (revision 34577) +++ target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-netgear.c (working copy) @@ -77,8 +77,8 @@ static struct gpio_led dgn3500_gpio_leds[] __initdata = { - { .name = "soc:green:power", .gpio = 34, .active_low = 1, }, - { .name = "soc:red:power", .gpio = 39, .active_low = 1, }, + { .name = "soc:green:power", .gpio = 34, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:red:power", .gpio = 39, .active_low = 1, .default_trigger = "default-on" }, { .name = "soc:orange:wlan", .gpio = 51, .active_low = 1, }, { .name = "soc:green:wps", .gpio = 52, .active_low = 1, }, { .name = "soc:green:usb", .gpio = 22, .active_low = 1, }, @@ -91,7 +91,7 @@ { .desc = "wps", .type = EV_KEY, - .code = BTN_0, + .code = KEY_WPS_BUTTON, .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL, .gpio = 54, .active_low = 1, @@ -99,8 +99,16 @@ { .desc = "reset", .type = EV_KEY, - .code = BTN_1, + .code = BTN_0, .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL, + .gpio = 53, + .active_low = 1, + }, + { + .desc = "rfkill", + .type = EV_KEY, + .code = KEY_RFKILL, + .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL, .gpio = 36, .active_low = 1, }, @@ -253,5 +261,5 @@ MIPS_MACHINE(LANTIQ_MACH_DGN3500B, "DGN3500B", -"Netgear DGN3500B", +"DGN3500B - Netgear D
Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On Thu, 2012-11-29 at 10:35 +, Conor O'Gorman wrote: > I don't want to drag this out longer than necessary. You used the phrase > 'hack'. What do you think is the preferred solution? If I had a better one, I would have used it. RFC, again. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On Wed, 2012-11-28 at 17:24 -0800, Daniel Gimpelevich wrote: > The config option is already in place, as I said above. The sensible > default _is_ the increment, which is what the vast majority of DSL > routers do. In most of the AR7 ones, however, this incremented MAC is > already a separate boot environment variable. I'm not seeing that on > lantiq so far, but I still may. > I don't want to drag this out longer than necessary. You used the phrase 'hack'. What do you think is the preferred solution? I see macdsl is the var on ar7. I failed to find info on non-openwrt lantiq systems. As you point out current openwrt lantiq goes with a poor choice. I am on a custom board and can adjust to suit. Thanks, Conor ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On Thu, 2012-11-29 at 00:32 +, Conor O'Gorman wrote: > br2684 picks that address if there is no 'set' mac and if the lower > level provides nothing. It is a valid address, Xerox. Whether or not it is technically valid might be rather open to interpretation at the other end. The validity of a MAC with a Xerox OUI and the rest as zero still has non-zero ambiguity. > I note that br2684 also has an ndo_set_mac_address(), enabling > ifconfig nas0 hw ether OO:UU:II:aa:bb:cc The way that's handled in OpenWrt is manually entering the MAC in /etc/config/network rather than having it correct out-of-the-box. That's _really_ not a solution. > If the adsl/atm headend decides to actually bridge out onto a real > ethernet, then it would be a good idea to have a reasonably unique MAC. > How common is this? I wouldn't think it's too common, but probably would > arise at some point. This is the way my current ISP handles things. This is the way my previous ISP handled things. This is also the way the ISP I had before that one handled things, way back in 2001. Also, for those on static IP's, all ISP's I've ever encountered, except one, handled things this way as well. > It may be appropriate to have it set the mac either from a config option > 'macaddr' like the ethernet bridge, or use a sensible default such as > the system serial/MAC, with or without some adjustment like an increment > or bit flip. > > Conor The config option is already in place, as I said above. The sensible default _is_ the increment, which is what the vast majority of DSL routers do. In most of the AR7 ones, however, this incremented MAC is already a separate boot environment variable. I'm not seeing that on lantiq so far, but I still may. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On Thu, 2012-11-29 at 00:17 +, David Woodhouse wrote: > On Wed, 2012-11-28 at 14:35 -0800, Daniel Gimpelevich wrote: > > The br2684 driver seems to expect that the MAC is already on the device > > before a virtual circuit is created, but it seems to leave the mechanism > > for doing so to the ATM driver. The only other working ATM driver in > > OpenWrt is for AR7, > > There's also solos-pci, as used on the Geos. > > I mostly use that with PPPoA, rather than PPPoEoA with the pointless MTU > breakage that that implies. But it does work fine with BR2684 with the > MAC address 00:00:01:00:00:00, which is what it ends up with. > br2684 picks that address if there is no 'set' mac and if the lower level provides nothing. It is a valid address, Xerox. I note that br2684 also has an ndo_set_mac_address(), enabling ifconfig nas0 hw ether OO:UU:II:aa:bb:cc > Do you actually *need* to set the MAC address on the br2684 link? > If the adsl/atm headend decides to actually bridge out onto a real ethernet, then it would be a good idea to have a reasonably unique MAC. How common is this? I wouldn't think it's too common, but probably would arise at some point. > Also, why is the br2684ctl package automatically starting br2684ctl at > boot, in the current AA builds? That actually prevents me from bringing > up the device in PPPoA mode. Surely br2684ctl should only be started if > it's actually been *configured*, and then only when the corresponding > network link is brought up? > I do not know. I was just routing my way around what the br2684 package does and does not do at start-up. It may be appropriate to have it set the mac either from a config option 'macaddr' like the ethernet bridge, or use a sensible default such as the system serial/MAC, with or without some adjustment like an increment or bit flip. Conor ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On Wed, 2012-11-28 at 16:28 -0800, Daniel Gimpelevich wrote: > On Thu, 2012-11-29 at 00:17 +, David Woodhouse wrote: > > I mostly use that with PPPoA, rather than PPPoEoA with the pointless MTU > > breakage that that implies. But it does work fine with BR2684 with the > > MAC address 00:00:01:00:00:00, which is what it ends up with. > > > > Do you actually *need* to set the MAC address on the br2684 link? > > > On circuits that assign an IP with DHCP, it is bound to its MAC address. > My ISP, for one, will assign multiple IP's to different MAC addresses on > the same circuit, to a point. That many zeros are not likely to pass > validation. The stock firmware increments the Ethernet MAC to get the > ATM one, which is clearly a sane thing for a DSL router to do. Ah, right. If you're using BR2684 for IP-over-Ethernet, instead of PPPoE, then yes you're likely to need a sane MAC address. -- dwmw2 smime.p7s Description: S/MIME cryptographic signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On Thu, 2012-11-29 at 00:17 +, David Woodhouse wrote: > I mostly use that with PPPoA, rather than PPPoEoA with the pointless MTU > breakage that that implies. But it does work fine with BR2684 with the > MAC address 00:00:01:00:00:00, which is what it ends up with. > > Do you actually *need* to set the MAC address on the br2684 link? > On circuits that assign an IP with DHCP, it is bound to its MAC address. My ISP, for one, will assign multiple IP's to different MAC addresses on the same circuit, to a point. That many zeros are not likely to pass validation. The stock firmware increments the Ethernet MAC to get the ATM one, which is clearly a sane thing for a DSL router to do. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On Wed, 2012-11-28 at 14:35 -0800, Daniel Gimpelevich wrote: > The br2684 driver seems to expect that the MAC is already on the device > before a virtual circuit is created, but it seems to leave the mechanism > for doing so to the ATM driver. The only other working ATM driver in > OpenWrt is for AR7, There's also solos-pci, as used on the Geos. I mostly use that with PPPoA, rather than PPPoEoA with the pointless MTU breakage that that implies. But it does work fine with BR2684 with the MAC address 00:00:01:00:00:00, which is what it ends up with. Do you actually *need* to set the MAC address on the br2684 link? Also, why is the br2684ctl package automatically starting br2684ctl at boot, in the current AA builds? That actually prevents me from bringing up the device in PPPoA mode. Surely br2684ctl should only be started if it's actually been *configured*, and then only when the corresponding network link is brought up? -- dwmw2 smime.p7s Description: S/MIME cryptographic signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On Wed, 2012-11-28 at 19:35 +, Conor O'Gorman wrote: > Hi Daniel, > > Thank you for consider my comments. > > There are a couple of points I'd make. AFAIK this is only needed for > ethernet bridging over atm. I am not familiar with an ethernet style > mac > being used in straight atm connections. As far as I can see the field > you are setting is only pulled out by the br2684 driver, which is > providing the ethernet veneer. > > I do see that one or two atm drivers get a serial number from their > hardware, and a few more pull up an eeprom value. > > Would some adjustment in br2684 be more appropriate? > > I have no problem with a hack, if it is recognised as such, with some > intention to improve it later. > > Concerning what MAC to apply, yes some variation on the serial number > is > appropriate. I have in the past used the top bits of the available > space, rather than a simple increment, as it avoids bumping into a > similar unit. > > Conor > The br2684 driver seems to expect that the MAC is already on the device before a virtual circuit is created, but it seems to leave the mechanism for doing so to the ATM driver. The only other working ATM driver in OpenWrt is for AR7, and that has always had the MAC set in the driver itself. If you know of a use case within OpenWrt but without br2684 for the lantiq ATM driver specifically, I'd like to hear it. I don't really like inserting code like this into a place like that, but the only alternative I could think of would be even worse: creating a sysfs node in the ATM driver to receive a list of MAC addresses (since the driver can handle more than one interface) from userspace before any virtual circuit is created. RFC. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On Wed, 2012-11-28 at 06:18 -0800, Daniel Gimpelevich wrote: > On Wed, 2012-11-28 at 10:09 +, Conor O'Gorman wrote: > > This will affect all lantiq atm boards? I specify an ethernet MAC via > > the command line, but I don't necessarily want it in the atm. > > > The existing code leaves the MAC at all zeros. Do you require that > instead of the MAC you specify for Ethernet? The latinq ATM driver > provides no way to have it be anything other than zeros at the driver > level. None. At least on the Netgear, the stock firmware increments the > Ethernet address to get the ATM one, and it receives the Ethernet > address and no other address on the kernel command line. I will soon be > looking at the Gigaset for comparison, but I expect it likely does the > same thing. It's perfectly reasonable not to want an increment of the > supplied Ethernet address in the ATM, but that implies you have some > other MAC you'd like it to have instead. If you can reveal where this > MAC comes from and how you'd like to supply it to the driver, that would > be a first step to de-uglifying this dirty hack. It really boggles my > mind that this has never been discussed before. > Hi Daniel, Thank you for consider my comments. There are a couple of points I'd make. AFAIK this is only needed for ethernet bridging over atm. I am not familiar with an ethernet style mac being used in straight atm connections. As far as I can see the field you are setting is only pulled out by the br2684 driver, which is providing the ethernet veneer. I do see that one or two atm drivers get a serial number from their hardware, and a few more pull up an eeprom value. Would some adjustment in br2684 be more appropriate? I have no problem with a hack, if it is recognised as such, with some intention to improve it later. Concerning what MAC to apply, yes some variation on the serial number is appropriate. I have in the past used the top bits of the available space, rather than a simple increment, as it avoids bumping into a similar unit. Conor ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On Wed, 2012-11-28 at 10:09 +, Conor O'Gorman wrote: > This will affect all lantiq atm boards? I specify an ethernet MAC via > the command line, but I don't necessarily want it in the atm. > > > Conor > The existing code leaves the MAC at all zeros. Do you require that instead of the MAC you specify for Ethernet? The latinq ATM driver provides no way to have it be anything other than zeros at the driver level. None. At least on the Netgear, the stock firmware increments the Ethernet address to get the ATM one, and it receives the Ethernet address and no other address on the kernel command line. I will soon be looking at the Gigaset for comparison, but I expect it likely does the same thing. It's perfectly reasonable not to want an increment of the supplied Ethernet address in the ATM, but that implies you have some other MAC you'd like it to have instead. If you can reveal where this MAC comes from and how you'd like to supply it to the driver, that would be a first step to de-uglifying this dirty hack. It really boggles my mind that this has never been discussed before. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On Tue, 2012-11-27 at 23:09 -0800, Daniel Gimpelevich wrote: > On Wed, 2012-11-28 at 07:53 +0100, John Crispin wrote: > > On 28/11/12 02:47, Daniel Gimpelevich wrote: > > > This corrects a few oversights in mach-netgear.c, adds a diag.sh with > > > per-board conditionals, in line with the uci-defaults "leds" file, fixes > > > the Netgear eth0 MAC address detection, and provides a mechanism for the > > > DSL driver to have a preset MAC address. > > > > > > Signed-off-by: Daniel Gimpelevich snip > > +if ((substr = strstr(saved_command_line, "ethaddr=")) != > saved_command_line) > +substr = strstr(saved_command_line, " ethaddr="); > +esiset = (substr != NULL && sscanf(substr, " > ethaddr=%2hhx:%2hhx:%2hhx:%2hhx:%2hhx:%2hhx", esi, esi + 1, esi + 2, esi + 3, > esi + 4, esi + 5) == 6); > /* create devices */ > for ( port_num = 0; port_num < ATM_PORT_NUMBER; port_num++ ) { > #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)) > @@ -4647,6 +4652,12 @@ > g_atm_priv_data.port[port_num].dev->ci_range.vci_bits = 16; > g_atm_priv_data.port[port_num].dev->link_rate = > g_atm_priv_data.port[port_num].tx_max_cell_rate; > g_atm_priv_data.port[port_num].dev->dev_data = (void*)port_num; > +if (esiset) { > +if (!++(esi[5])) > +if (!++(esi[4])) > +esi[3]++; > +memcpy(g_atm_priv_data.port[port_num].dev->esi, esi, 6); > +} > } > } This will affect all lantiq atm boards? I specify an ethernet MAC via the command line, but I don't necessarily want it in the atm. Conor ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On Wed, 2012-11-28 at 07:53 +0100, John Crispin wrote: > On 28/11/12 02:47, Daniel Gimpelevich wrote: > > This corrects a few oversights in mach-netgear.c, adds a diag.sh with > > per-board conditionals, in line with the uci-defaults "leds" file, fixes > > the Netgear eth0 MAC address detection, and provides a mechanism for the > > DSL driver to have a preset MAC address. > > > > Signed-off-by: Daniel Gimpelevich > > > > > > > > ___ > > openwrt-devel mailing list > > openwrt-devel@lists.openwrt.org > > https://lists.openwrt.org/mailman/listinfo/openwrt-devel > > > please send the patch inline Whoops. Signed-off-by: Daniel Gimpelevich Index: target/linux/lantiq/image/Makefile === --- target/linux/lantiq/image/Makefile (revision 34398) +++ target/linux/lantiq/image/Makefile (working copy) @@ -154,7 +154,7 @@ ifeq ($(CONFIG_TARGET_lantiq_ar9),y) Image/BuildKernel/Profile/WBMR=$(call Image/BuildKernel/Template,WBMR,$(xway_cmdline)) -Image/BuildKernel/Profile/DGN3500B=$(call Image/BuildKernel/Template,DGN3500B,$(xway_cmdline)) +Image/BuildKernel/Profile/DGN3500B=$(call Image/BuildKernel/Template,DGN3500B,$(sx76x_cmdline)) Image/BuildKernel/Profile/P2601HNFX=$(call Image/BuildKernel/Template,P2601HNFX,$(xway_cmdline)) Image/BuildKernel/Profile/H201L=$(call Image/BuildKernel/Template,H201L,$(xway_cmdline)) Image/BuildKernel/Profile/FRITZ7320=$(call Image/BuildKernelEVA/Template,FRITZ7320,$(xway_cmdline)) Index: target/linux/lantiq/patches-3.3/0026-cmdline.patch === --- target/linux/lantiq/patches-3.3/0026-cmdline.patch (revision 0) +++ target/linux/lantiq/patches-3.3/0026-cmdline.patch (revision 0) @@ -0,0 +1,10 @@ +--- a/init/main.c b/init/main.c +@@ -123,6 +123,7 @@ + char __initdata boot_command_line[COMMAND_LINE_SIZE]; + /* Untouched saved command line (eg. for /proc) */ + char *saved_command_line; ++EXPORT_SYMBOL(saved_command_line); + /* Command line for parameter parsing */ + static char *static_command_line; + Index: target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-netgear.c === --- target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-netgear.c (revision 34398) +++ target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-netgear.c (working copy) @@ -77,8 +77,8 @@ static struct gpio_led dgn3500_gpio_leds[] __initdata = { - { .name = "soc:green:power", .gpio = 34, .active_low = 1, }, - { .name = "soc:red:power", .gpio = 39, .active_low = 1, }, + { .name = "soc:green:power", .gpio = 34, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:red:power", .gpio = 39, .active_low = 1, .default_trigger = "default-on" }, { .name = "soc:orange:wlan", .gpio = 51, .active_low = 1, }, { .name = "soc:green:wps", .gpio = 52, .active_low = 1, }, { .name = "soc:green:usb", .gpio = 22, .active_low = 1, }, @@ -91,7 +91,7 @@ { .desc = "wps", .type = EV_KEY, - .code = BTN_0, + .code = BTN_2, .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL, .gpio = 54, .active_low = 1, @@ -101,6 +101,14 @@ .type = EV_KEY, .code = BTN_1, .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL, + .gpio = 53, + .active_low = 1, + }, + { + .desc = "rfkill", + .type = EV_KEY, + .code = BTN_0, + .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL, .gpio = 36, .active_low = 1, }, @@ -253,5 +261,5 @@ MIPS_MACHINE(LANTIQ_MACH_DGN3500B, "DGN3500B", -"Netgear DGN3500B", +"DGN3500B - Netgear DGN3500 or DGN3500B", dgn3500_init); Index: target/linux/lantiq/base-files/lib/preinit/42_athfix === --- target/linux/lantiq/base-files/lib/preinit/42_athfix(revision 34398) +++ target/linux/lantiq/base-files/lib/preinit/42_athfix(working copy) @@ -5,7 +5,7 @@ init_atheeprom() { local board=$(lantiq_board_name) case $board in - "Netgear DGN3500B") + DGN3500B) echo "- loading eeprom -" dd if=/dev/mtd2 of=/sys/firmware/ath_eeprom bs=1k skip=60 count=4 echo 0 > /sys/bus/pci/slots/\:00\:0e.0/power Index: target/linux/lantiq/base-files/etc/diag.sh === --- target/linux/lantiq/base-files/etc/diag.sh (revision 0) +++ target/linux/lantiq/base-files/etc/diag.sh (revision 0) @@ -0,0 +1,48 @@ +#!/bin/sh +# Copyright (C) 2006-2012 OpenWrt.org + +# This setup gives us 4.5 disting
Re: [OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
On 28/11/12 02:47, Daniel Gimpelevich wrote: This corrects a few oversights in mach-netgear.c, adds a diag.sh with per-board conditionals, in line with the uci-defaults "leds" file, fixes the Netgear eth0 MAC address detection, and provides a mechanism for the DSL driver to have a preset MAC address. Signed-off-by: Daniel Gimpelevich ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel please send the patch inline ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] lantiq and Netgear fixes/enhancements
This corrects a few oversights in mach-netgear.c, adds a diag.sh with per-board conditionals, in line with the uci-defaults "leds" file, fixes the Netgear eth0 MAC address detection, and provides a mechanism for the DSL driver to have a preset MAC address. Signed-off-by: Daniel Gimpelevich Index: target/linux/lantiq/image/Makefile === --- target/linux/lantiq/image/Makefile (revision 34398) +++ target/linux/lantiq/image/Makefile (working copy) @@ -154,7 +154,7 @@ ifeq ($(CONFIG_TARGET_lantiq_ar9),y) Image/BuildKernel/Profile/WBMR=$(call Image/BuildKernel/Template,WBMR,$(xway_cmdline)) -Image/BuildKernel/Profile/DGN3500B=$(call Image/BuildKernel/Template,DGN3500B,$(xway_cmdline)) +Image/BuildKernel/Profile/DGN3500B=$(call Image/BuildKernel/Template,DGN3500B,$(sx76x_cmdline)) Image/BuildKernel/Profile/P2601HNFX=$(call Image/BuildKernel/Template,P2601HNFX,$(xway_cmdline)) Image/BuildKernel/Profile/H201L=$(call Image/BuildKernel/Template,H201L,$(xway_cmdline)) Image/BuildKernel/Profile/FRITZ7320=$(call Image/BuildKernelEVA/Template,FRITZ7320,$(xway_cmdline)) Index: target/linux/lantiq/patches-3.3/0026-cmdline.patch === --- target/linux/lantiq/patches-3.3/0026-cmdline.patch (revision 0) +++ target/linux/lantiq/patches-3.3/0026-cmdline.patch (revision 0) @@ -0,0 +1,10 @@ +--- a/init/main.c b/init/main.c +@@ -123,6 +123,7 @@ + char __initdata boot_command_line[COMMAND_LINE_SIZE]; + /* Untouched saved command line (eg. for /proc) */ + char *saved_command_line; ++EXPORT_SYMBOL(saved_command_line); + /* Command line for parameter parsing */ + static char *static_command_line; + Index: target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-netgear.c === --- target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-netgear.c (revision 34398) +++ target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-netgear.c (working copy) @@ -77,8 +77,8 @@ static struct gpio_led dgn3500_gpio_leds[] __initdata = { - { .name = "soc:green:power", .gpio = 34, .active_low = 1, }, - { .name = "soc:red:power", .gpio = 39, .active_low = 1, }, + { .name = "soc:green:power", .gpio = 34, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:red:power", .gpio = 39, .active_low = 1, .default_trigger = "default-on" }, { .name = "soc:orange:wlan", .gpio = 51, .active_low = 1, }, { .name = "soc:green:wps", .gpio = 52, .active_low = 1, }, { .name = "soc:green:usb", .gpio = 22, .active_low = 1, }, @@ -91,7 +91,7 @@ { .desc = "wps", .type = EV_KEY, - .code = BTN_0, + .code = BTN_2, .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL, .gpio = 54, .active_low = 1, @@ -101,6 +101,14 @@ .type = EV_KEY, .code = BTN_1, .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL, + .gpio = 53, + .active_low = 1, + }, + { + .desc = "rfkill", + .type = EV_KEY, + .code = BTN_0, + .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL, .gpio = 36, .active_low = 1, }, @@ -253,5 +261,5 @@ MIPS_MACHINE(LANTIQ_MACH_DGN3500B, "DGN3500B", - "Netgear DGN3500B", + "DGN3500B - Netgear DGN3500 or DGN3500B", dgn3500_init); Index: target/linux/lantiq/base-files/lib/preinit/42_athfix === --- target/linux/lantiq/base-files/lib/preinit/42_athfix (revision 34398) +++ target/linux/lantiq/base-files/lib/preinit/42_athfix (working copy) @@ -5,7 +5,7 @@ init_atheeprom() { local board=$(lantiq_board_name) case $board in - "Netgear DGN3500B") + DGN3500B) echo "- loading eeprom -" dd if=/dev/mtd2 of=/sys/firmware/ath_eeprom bs=1k skip=60 count=4 echo 0 > /sys/bus/pci/slots/\:00\:0e.0/power Index: target/linux/lantiq/base-files/etc/diag.sh === --- target/linux/lantiq/base-files/etc/diag.sh (revision 0) +++ target/linux/lantiq/base-files/etc/diag.sh (revision 0) @@ -0,0 +1,48 @@ +#!/bin/sh +# Copyright (C) 2006-2012 OpenWrt.org + +# This setup gives us 4.5 distinguishable states: +# +# Solid YELLOW: Bootloader running, or kernel hung (timer task stalled) +# Solid RED:preinit +# 5Hz blink:failsafe +# Solid GREEN: normal operation + +. /lib/lantiq.sh + +set_state() { +board=$(lantiq_board_name) +case "$1" in +preinit) +{ +case "$board" in +DGN3500B) +echo none >/sys/class/leds/soc\:green\:power/trigger +;; +esac +} +;; +failsafe) +{ +case "$board" in +DGN3500