Re: [OpenWrt-Devel] [iptables] iptables broken ?

2012-11-25 Thread shazz
oh ! the mighty underscore :)

I try !

On Sun, Nov 25, 2012 at 1:12 AM, Szabolcs Nagy  wrote:
> * Frank Meerk?tter  [2012-11-24 22:25:26 +0100]:
>> On 24/11/12 20:49, shazz wrote:
>> > error: nested redefinition of 'enum tcp_ca_state'
>> > /var/www/LOG/openwrt/tpl703n/trunk/build_dir/linux-ar71xx_generic_eglibc-2.16/linux-3.3.8/user_headers/include/linux/tcp.h:117:6:
>>
>> Revert
>> 4cf1359d5dc38debc89834d895f9a3951044bf90
>> [package] iptables: add some musl portability fixes
>> as a workaround.
>>
>
> there seems to be a typo in the iptables musl_fixes.patch:
>
> diff --git a/package/network/utils/iptables/patches/300-musl_fixes.patch 
> b/package/network/utils/iptables/patches/300-musl_fixe
> index b6f6a0e..e329aa9 100644
> --- a/package/network/utils/iptables/patches/300-musl_fixes.patch
> +++ b/package/network/utils/iptables/patches/300-musl_fixes.patch
> @@ -66,7 +66,7 @@
>   #define _XT_OSF_H
>
>   #include 
> -+#if !defined(__UCLIBC__) && !defined(__GLIBC_)
> ++#if !defined(__UCLIBC__) && !defined(__GLIBC__)
>  +#include 
>  +#endif
>
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/3] AA: mac80211/rt2x00: backport r34268

2012-11-25 Thread Daniel Golle
Signed-off-by: Daniel Golle 
---
 .../patches/622-rt2x00-fix-rt3352-ext-pa.patch | 212 +
 1 file changed, 212 insertions(+)
 create mode 100644 package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch

diff --git a/package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch 
b/package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch
new file mode 100644
index 000..8015a12
--- /dev/null
+++ b/package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch
@@ -0,0 +1,212 @@
+--- a/drivers/net/wireless/rt2x00/rt2800lib.c
 b/drivers/net/wireless/rt2x00/rt2800lib.c
+@@ -2271,15 +2271,18 @@ static void rt2800_config_channel(struct
+   /*
+* Change BBP settings
+*/
++  rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev->lna_gain);
++  rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev->lna_gain);
++  rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev->lna_gain);
++
+   if (rt2x00_rt(rt2x00dev, RT3352)) {
+   rt2800_bbp_write(rt2x00dev, 27, 0x0);
+   rt2800_bbp_write(rt2x00dev, 66, 0x26 + rt2x00dev->lna_gain);
+   rt2800_bbp_write(rt2x00dev, 27, 0x20);
+   rt2800_bbp_write(rt2x00dev, 66, 0x26 + rt2x00dev->lna_gain);
++  rt2800_bbp_write(rt2x00dev, 86, 0x38);
++  rt2800_bbp_write(rt2x00dev, 83, 0x6a);
+   } else {
+-  rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev->lna_gain);
+-  rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev->lna_gain);
+-  rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev->lna_gain);
+   rt2800_bbp_write(rt2x00dev, 86, 0);
+   }
+ 
+@@ -3850,6 +3853,7 @@ static int rt2800_init_rfcsr(struct rt2x
+* Init RF calibration.
+*/
+   if (rt2x00_rt(rt2x00dev, RT3290) ||
++  rt2x00_rt(rt2x00dev, RT3352) ||
+   rt2x00_rt(rt2x00dev, RT5390) ||
+   rt2x00_rt(rt2x00dev, RT5392)) {
+   rt2800_rfcsr_read(rt2x00dev, 2, &rfcsr);
+@@ -4036,6 +4040,10 @@ static int rt2800_init_rfcsr(struct rt2x
+   rt2800_rfcsr_write(rt2x00dev, 31, 0x00);
+   return 0;
+   } else if (rt2x00_rt(rt2x00dev, RT3352)) {
++  int tx0_int_pa = test_bit(CAPABILITY_INTERNAL_PA_TX0,
++&rt2x00dev->cap_flags);
++  int tx1_int_pa = test_bit(CAPABILITY_INTERNAL_PA_TX1,
++&rt2x00dev->cap_flags);
+   rt2800_rfcsr_write(rt2x00dev, 0, 0xf0);
+   rt2800_rfcsr_write(rt2x00dev, 1, 0x23);
+   rt2800_rfcsr_write(rt2x00dev, 2, 0x50);
+@@ -4069,15 +4077,30 @@ static int rt2800_init_rfcsr(struct rt2x
+   rt2800_rfcsr_write(rt2x00dev, 31, 0x80);
+   rt2800_rfcsr_write(rt2x00dev, 32, 0x80);
+   rt2800_rfcsr_write(rt2x00dev, 33, 0x00);
+-  rt2800_rfcsr_write(rt2x00dev, 34, 0x01);
++  rfcsr =  0x01;
++  if (!tx0_int_pa)
++  rt2x00_set_field8(&rfcsr, RFCSR34_TX0_EXT_PA, 1);
++  if (!tx1_int_pa)
++  rt2x00_set_field8(&rfcsr, RFCSR34_TX1_EXT_PA, 1);
++  rt2800_rfcsr_write(rt2x00dev, 34, rfcsr );
+   rt2800_rfcsr_write(rt2x00dev, 35, 0x03);
+   rt2800_rfcsr_write(rt2x00dev, 36, 0xbd);
+   rt2800_rfcsr_write(rt2x00dev, 37, 0x3c);
+   rt2800_rfcsr_write(rt2x00dev, 38, 0x5f);
+   rt2800_rfcsr_write(rt2x00dev, 39, 0xc5);
+   rt2800_rfcsr_write(rt2x00dev, 40, 0x33);
+-  rt2800_rfcsr_write(rt2x00dev, 41, 0x5b);
+-  rt2800_rfcsr_write(rt2x00dev, 42, 0x5b);
++  rfcsr = 0x52;
++  if (tx0_int_pa) {
++  rt2x00_set_field8(&rfcsr, RFCSR41_BIT1, 1);
++  rt2x00_set_field8(&rfcsr, RFCSR41_BIT4, 1);
++  }
++  rt2800_rfcsr_write(rt2x00dev, 41, rfcsr);
++  rfcsr = 0x52;
++  if (tx1_int_pa) {
++  rt2x00_set_field8(&rfcsr, RFCSR42_BIT1, 1);
++  rt2x00_set_field8(&rfcsr, RFCSR42_BIT4, 1);
++  }
++  rt2800_rfcsr_write(rt2x00dev, 42, rfcsr);
+   rt2800_rfcsr_write(rt2x00dev, 43, 0xdb);
+   rt2800_rfcsr_write(rt2x00dev, 44, 0xdb);
+   rt2800_rfcsr_write(rt2x00dev, 45, 0xdb);
+@@ -4085,15 +4108,20 @@ static int rt2800_init_rfcsr(struct rt2x
+   rt2800_rfcsr_write(rt2x00dev, 47, 0x0d);
+   rt2800_rfcsr_write(rt2x00dev, 48, 0x14);
+   rt2800_rfcsr_write(rt2x00dev, 49, 0x00);
+-  rt2800_rfcsr_write(rt2x00dev, 50, 0x2d);
+-  rt2800_rfcsr_write(rt2x00dev, 51, 0x7f);
+-  rt2800_rfcsr_write(rt2x00dev, 52, 0x00);
+-  rt2800_rfcsr_write(rt2x00dev, 53, 0x52);
+-  rt2800_rfcsr_write(rt2x00dev, 54, 0x1b);
+-  rt2800_rfcsr_write(rt2x00dev, 55, 0x7f);
+-

[OpenWrt-Devel] [PATCH 2/3] AA: mac80211/rt2x00: backport r34269

2012-11-25 Thread Daniel Golle
Signed-off-by: Daniel Golle 
---
 .../patches/623-rt2x00-rf_vals-rt3352-xtal20.patch | 121 +
 .../generic/files/include/linux/rt2x00_platform.h  |   1 +
 2 files changed, 122 insertions(+)
 create mode 100644 
package/mac80211/patches/623-rt2x00-rf_vals-rt3352-xtal20.patch

diff --git a/package/mac80211/patches/623-rt2x00-rf_vals-rt3352-xtal20.patch 
b/package/mac80211/patches/623-rt2x00-rf_vals-rt3352-xtal20.patch
new file mode 100644
index 000..e240488
--- /dev/null
+++ b/package/mac80211/patches/623-rt2x00-rf_vals-rt3352-xtal20.patch
@@ -0,0 +1,121 @@
+Index: compat-wireless-2012-09-07/drivers/net/wireless/rt2x00/rt2800lib.c
+===
+--- compat-wireless-2012-09-07.orig/drivers/net/wireless/rt2x00/rt2800lib.c
 compat-wireless-2012-09-07/drivers/net/wireless/rt2x00/rt2800lib.c
+@@ -5072,6 +5072,27 @@ static const struct rf_channel rf_vals_3
+   {173, 0x61, 0, 9},
+ };
+ 
++/*
++ * RF value list for rt3xxx with Xtal20MHz
++ * Supports: 2.4 GHz (all) (RF3322)
++ */
++static const struct rf_channel rf_vals_xtal20mhz_3x[] = {
++  {1,0xE2, 2,  0x14},
++  {2,0xE3, 2,  0x14},
++  {3,0xE4, 2,  0x14},
++  {4,0xE5, 2,  0x14},
++  {5,0xE6, 2,  0x14},
++  {6,0xE7, 2,  0x14},
++  {7,0xE8, 2,  0x14},
++  {8,0xE9, 2,  0x14},
++  {9,0xEA, 2,  0x14},
++  {10,   0xEB, 2,  0x14},
++  {11,   0xEC, 2,  0x14},
++  {12,   0xED, 2,  0x14},
++  {13,   0xEE, 2,  0x14},
++  {14,   0xF0, 2,  0x18},
++};
++
+ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
+ {
+   struct hw_mode_spec *spec = &rt2x00dev->spec;
+@@ -5149,7 +5170,6 @@ static int rt2800_probe_hw_mode(struct r
+  rt2x00_rf(rt2x00dev, RF3022) ||
+  rt2x00_rf(rt2x00dev, RF3290) ||
+  rt2x00_rf(rt2x00dev, RF3320) ||
+- rt2x00_rf(rt2x00dev, RF3322) ||
+  rt2x00_rf(rt2x00dev, RF5360) ||
+  rt2x00_rf(rt2x00dev, RF5370) ||
+  rt2x00_rf(rt2x00dev, RF5372) ||
+@@ -5157,6 +5177,12 @@ static int rt2800_probe_hw_mode(struct r
+  rt2x00_rf(rt2x00dev, RF5392)) {
+   spec->num_channels = 14;
+   spec->channels = rf_vals_3x;
++  } else if (rt2x00_rf(rt2x00dev, RF3322)) {
++  spec->num_channels = 14;
++  if (spec->clk_is_20mhz)
++  spec->channels = rf_vals_xtal20mhz_3x;
++  else
++  spec->channels = rf_vals_3x;
+   } else if (rt2x00_rf(rt2x00dev, RF3052)) {
+   spec->supported_bands |= SUPPORT_BAND_5GHZ;
+   spec->num_channels = ARRAY_SIZE(rf_vals_3x);
+@@ -5250,6 +5276,19 @@ static int rt2800_probe_hw_mode(struct r
+   return 0;
+ }
+ 
++int rt2800_probe_clk(struct rt2x00_dev *rt2x00dev)
++{
++  struct rt2x00_platform_data *pdata = rt2x00dev->dev->platform_data;
++  struct hw_mode_spec *spec = &rt2x00dev->spec;
++
++  if (!pdata)
++  return -EINVAL;
++
++  spec->clk_is_20mhz = pdata->clk_is_20mhz;
++
++  return 0;
++}
++
+ int rt2800_probe_hw(struct rt2x00_dev *rt2x00dev)
+ {
+   int retval;
+@@ -5275,6 +5314,15 @@ int rt2800_probe_hw(struct rt2x00_dev *r
+   rt2800_register_write(rt2x00dev, GPIO_CTRL, reg);
+ 
+   /*
++   * Probe SoC clock.
++   */
++  if (rt2x00_is_soc(rt2x00dev)) {
++  retval = rt2800_probe_clk(rt2x00dev);
++  if (retval)
++  return retval;
++  }
++
++  /*
+* Initialize hw specifications.
+*/
+   retval = rt2800_probe_hw_mode(rt2x00dev);
+Index: compat-wireless-2012-09-07/drivers/net/wireless/rt2x00/rt2x00.h
+===
+--- compat-wireless-2012-09-07.orig/drivers/net/wireless/rt2x00/rt2x00.h
 compat-wireless-2012-09-07/drivers/net/wireless/rt2x00/rt2x00.h
+@@ -421,6 +421,7 @@ static inline struct rt2x00_intf* vif_to
+  * @channels: Device/chipset specific channel values (See &struct rf_channel).
+  * @channels_info: Additional information for channels (See &struct 
channel_info).
+  * @ht: Driver HT Capabilities (See &ieee80211_sta_ht_cap).
++ * @clk_is_20mhz: External crystal of WiSoC is 20MHz instead of 40MHz
+  */
+ struct hw_mode_spec {
+   unsigned int supported_bands;
+@@ -437,6 +438,7 @@ struct hw_mode_spec {
+   const struct channel_info *channels_info;
+ 
+   struct ieee80211_sta_ht_cap ht;
++  int clk_is_20mhz;
+ };
+ 
+ /*
+Index: compat-wireless-2012-09-07/include/linux/rt2x00_platform.h
+===
+--- compat-wireless-2012-09-07.orig/include/linux/rt2x00_platform.h
 compat-wireless-2012-09-07/include/linux/rt2x00_platform.h
+@@ -18,6 +18,7 @@ struct rt2x00_platform_data {
+ 
+   

[OpenWrt-Devel] [PATCH 3/3] AA: ramips: backport r34270

2012-11-25 Thread Daniel Golle
Signed-off-by: Daniel Golle 
---
 .../ramips/files/arch/mips/include/asm/mach-ralink/rt305x_regs.h  | 2 ++
 target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c   | 8 
 2 files changed, 10 insertions(+)

diff --git 
a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x_regs.h 
b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x_regs.h
index 949232d..943facb 100644
--- a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x_regs.h
+++ b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x_regs.h
@@ -111,6 +111,8 @@
 #define RT5350_SYSCFG0_DRAM_SIZE_32M   3
 #define RT5350_SYSCFG0_DRAM_SIZE_64M   4
 
+#define RT3352_SYSCFG0_XTAL_SELBIT(20)
+
 #define RT3352_SYSCFG1_USB0_HOST_MODE  BIT(10)
 
 #define RT3352_CLKCFG1_UPHY0_CLK_ENBIT(18)
diff --git a/target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c 
b/target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c
index 92ae56d..56eae8a 100644
--- a/target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c
+++ b/target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c
@@ -215,7 +215,15 @@ static struct platform_device rt305x_wifi_device = {
 
 void __init rt305x_register_wifi(void)
 {
+   u32 t;
rt305x_wifi_data.eeprom_file_name = "RT305X.eeprom";
+
+   if (soc_is_rt3352() || soc_is_rt5350()) {
+   t = rt305x_sysc_rr(SYSC_REG_SYSTEM_CONFIG);
+   t &= RT3352_SYSCFG0_XTAL_SEL;
+   if (!t)
+   rt305x_wifi_data.clk_is_20mhz = 1;
+   }
platform_device_register(&rt305x_wifi_device);
 }
 
-- 
1.8.0



pgpZToxLtUrN4.pgp
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] musl patches are breaking the eglibc build

2012-11-25 Thread Florian Fainelli
Hi Frank,

Le samedi 24 novembre 2012 22:23:08, Frank Meerkötter a écrit :
> Hi Florian,
> 
> your recent work to add support for the musl-libc
> is breaking the build for eglibc-based toolchains.

Whoops, sorry about that.

> 
> Reverting
> 4cf1359d5dc38debc89834d895f9a3951044bf90
> [package] iptables: add some musl portability fixes
> fixes the building of iptables.
> 
> Reverting
> acd937382fefda95988b6dc279cf8989be4d6747
> [buildroot] add preliminary support for musl
> fixes the building of the hotplug2 package.
> 
> Could you please have a look?

I am having a look right now.

Thanks for spotting these issues.
-- 
Florian
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] musl patches are breaking the eglibc build

2012-11-25 Thread Florian Fainelli
Le dimanche 25 novembre 2012 11:55:08, Florian Fainelli a écrit :
> Hi Frank,
> 
> Le samedi 24 novembre 2012 22:23:08, Frank Meerkötter a écrit :
> > Hi Florian,
> > 
> > your recent work to add support for the musl-libc
> > is breaking the build for eglibc-based toolchains.
> 
> Whoops, sorry about that.
> 
> > Reverting
> > 4cf1359d5dc38debc89834d895f9a3951044bf90
> > [package] iptables: add some musl portability fixes
> > fixes the building of iptables.
> > 
> > Reverting
> > acd937382fefda95988b6dc279cf8989be4d6747
> > [buildroot] add preliminary support for musl
> > fixes the building of the hotplug2 package.

What is wrong with the hotplug2 package build? I don't have any problem 
building it here.
-- 
Florian
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [iptables] iptables broken ?

2012-11-25 Thread Florian Fainelli
Le dimanche 25 novembre 2012 11:07:33, shazz a écrit :
> oh ! the mighty underscore :)
> 
> I try !

Fixed with r34326 thank you all!
-- 
Florian
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [musl] Support for musl libc in OpenWrt

2012-11-25 Thread Florian Fainelli
Le samedi 24 novembre 2012 07:15:33, Isaac Dunham a écrit :
> On Fri, 23 Nov 2012 21:10:33 +0100
> 
> Florian Fainelli  wrote:
> > Hi All,
> > 
> > Support for musl libc in OpenWrt has been added in revision r34314,
> 
> Glad to hear it!
> 
> > Note that the following issues are known:
> > 
> > - unable to complete libstdc++ build due to some missing declarations
> > (WIP)
> 
> Are you using the default "linux-gnu" libstdc++, or the "generic" target?
> Only the latter is known to work at this point.

It is the linux-gnu libstdc++, we do not support building the "generic" one 
yet, might be worth supporting it now.

> 
> > - MIPS and MIPSel ports are not functionnal (details below)
> > 
> > --
> > MIPS and MIPSel specific issues:
> > 
> > using qemu's binary emulation (qemu-mips[el]) against a statically
> > linked binary works, a dynamic binary makes my host qemu segv. Using
> > qemu-system-mips[el], the binary segfaults while being executed by the
> > kernel. So far I have not had the time to debug this further.
> 
> There are likely other issues, but are you using a hardfloat-compatible
> kernel (FPU emulation enabled)? 

No, we have patched the kernel do disable the hardware FPU emulation, which 
was actually the issue, because musl setjmp MIPS-specific code tried to access 
Cop1 registers. After patching setjmp not to access these it works flawlessly 
on MIPS (big-endian) but MIPS (little-endian) still segfaults while being 
executed either from the kernel or qemu-mipsel.

> At present, musl/mips relies on certain
> instructions that the kernel  ordinarily emulates when they aren't
> supported.

You mean ll/sc right? I build for MIPS32r2 so this should not be an issue.
-- 
Florian
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [musl] Support for musl libc in OpenWrt

2012-11-25 Thread Szabolcs Nagy
* Florian Fainelli  [2012-11-25 12:46:26 +0100]:
> Cop1 registers. After patching setjmp not to access these it works flawlessly 
> on MIPS (big-endian) but MIPS (little-endian) still segfaults while being 
> executed either from the kernel or qemu-mipsel.
> 

so there is endian issue with dynamic linking

musl c code should not depend on endianness
(eg on x86 it works fine) so i guess the issue
is mips specific

maybe something in mips asm

or maybe there is some difference between
mips and mipsel other than the endianness?
(elf header or auxv something, or the build
toolchain is different in some way)

can you run libc.so itself?

/lib/libc.so

should print a usage message

if it works then try to run it as ldd on
a dynlinked binary
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2][BCM63XX] Add a fixup for rt2x00 devices.

2012-11-25 Thread Álvaro Fernández Rojas
Fix typo in 96338GW power LED.

Signed-off-by: Álvaro Fernández Rojas 
---
Add SOB.

diff --git a/target/linux/brcm63xx/patches-3.3/310-board_leds_naming.patch 
b/target/linux/brcm63xx/patches-3.3/310-board_leds_naming.patch
index 798e801..df4ddb4 100644
--- a/target/linux/brcm63xx/patches-3.3/310-board_leds_naming.patch
+++ b/target/linux/brcm63xx/patches-3.3/310-board_leds_naming.patch
@@ -23,7 +23,7 @@
},
{
 -  .name   = "power",
-+  .name   = "96338GW!green:power",
++  .name   = "96338GW:green:power",
.gpio   = 0,
.active_low = 1,
.default_trigger = "default-on",
diff --git a/target/linux/brcm63xx/patches-3.6/310-board_leds_naming.patch 
b/target/linux/brcm63xx/patches-3.6/310-board_leds_naming.patch
index 84603b0..8b307a2 100644
--- a/target/linux/brcm63xx/patches-3.6/310-board_leds_naming.patch
+++ b/target/linux/brcm63xx/patches-3.6/310-board_leds_naming.patch
@@ -23,7 +23,7 @@
},
{
 -  .name   = "power",
-+  .name   = "96338GW!green:power",
++  .name   = "96338GW:green:power",
.gpio   = 0,
.active_low = 1,
.default_trigger = "default-on",
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] [package] base-files: add support for the morse LED trigger

2012-11-25 Thread Petr Viktorin
>From d38c8ab2c40f368a783684d2214ec81b3cac8e11 Mon Sep 17 00:00:00 2001
From: Petr Viktorin 
Date: Sun, 25 Nov 2012 14:36:03 +0100
Subject: [PATCH] [package] base-files: add support for the morse LED trigger

Write "delay" and "message" options to their respective files,
allowing Morse code message configuration through UCI.
The delay (dit length) defaults to 150ms (about 8 words per minute,
suitable for beginners).

Signed-off-by: Petr Viktorin 
---
Hello! Newbie here, hopefully I got all the formalities right.

Anyone who can read the password of the day off my router is free to connect!

 package/base-files/Makefile | 2 +-
 package/base-files/files/etc/init.d/led | 7 +++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index 972f96b..7a2e216 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
 include $(INCLUDE_DIR)/version.mk

 PKG_NAME:=base-files
-PKG_RELEASE:=119
+PKG_RELEASE:=120

 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
 PKG_BUILD_DEPENDS:=opkg/host
diff --git a/package/base-files/files/etc/init.d/led
b/package/base-files/files/etc/init.d/led
index f3f3c3f..729796b 100755
--- a/package/base-files/files/etc/init.d/led
+++ b/package/base-files/files/etc/init.d/led
@@ -24,6 +24,8 @@ load_led() {
config_get delayoff $1 delayoff
config_get interval $1 interval "50"
config_get port_state $1 port_state
+   config_get delay $1 delay "150"
+   config_get message $1 message ""

if [ "$trigger" = "rssi" ]; then
# handled by rssileds userspace process
@@ -66,6 +68,11 @@ load_led() {
echo $port_state > 
/sys/class/leds/${sysfs}/port_state
;;

+   "morse")
+   echo $message > /sys/class/leds/${sysfs}/message
+   echo $delay > /sys/class/leds/${sysfs}/delay
+   ;;
+
switch[0-9]*)
local port_mask

-- 
1.7.11.7
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] musl patches are breaking the eglibc build

2012-11-25 Thread Frank Meerkötter
On 25/11/12 12:41, Florian Fainelli wrote:
[...]
>> Whoops, sorry about that.
>>
>>> Reverting
>>> 4cf1359d5dc38debc89834d895f9a3951044bf90
>>> [package] iptables: add some musl portability fixes
>>> fixes the building of iptables.
>>>
>>> Reverting
>>> acd937382fefda95988b6dc279cf8989be4d6747
>>> [buildroot] add preliminary support for musl
>>> fixes the building of the hotplug2 package.
> 
> What is wrong with the hotplug2 package build? I don't have any problem 
> building it here.

I did a
make clean && make
and now it just works. Sorry for bothering you.

iptables builds fine now, thanks!

Regards,
Frank


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


[OpenWrt-Devel] [PATCH v3][BCM63XX] Fix typo in 96338GW power LED.

2012-11-25 Thread Álvaro Fernández Rojas
Fix typo in 96338GW power LED.

Signed-off-by: Álvaro Fernández Rojas 
---
Add SOB.
Wrong matter on v2 mail.

diff --git a/target/linux/brcm63xx/patches-3.3/310-board_leds_naming.patch 
b/target/linux/brcm63xx/patches-3.3/310-board_leds_naming.patch
index 798e801..df4ddb4 100644
--- a/target/linux/brcm63xx/patches-3.3/310-board_leds_naming.patch
+++ b/target/linux/brcm63xx/patches-3.3/310-board_leds_naming.patch
@@ -23,7 +23,7 @@
},
{
 -  .name   = "power",
-+  .name   = "96338GW!green:power",
++  .name   = "96338GW:green:power",
.gpio   = 0,
.active_low = 1,
.default_trigger = "default-on",
diff --git a/target/linux/brcm63xx/patches-3.6/310-board_leds_naming.patch 
b/target/linux/brcm63xx/patches-3.6/310-board_leds_naming.patch
index 84603b0..8b307a2 100644
--- a/target/linux/brcm63xx/patches-3.6/310-board_leds_naming.patch
+++ b/target/linux/brcm63xx/patches-3.6/310-board_leds_naming.patch
@@ -23,7 +23,7 @@
},
{
 -  .name   = "power",
-+  .name   = "96338GW!green:power",
++  .name   = "96338GW:green:power",
.gpio   = 0,
.active_low = 1,
.default_trigger = "default-on",
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ramips: add DIR-615 D userspace support

2012-11-25 Thread Gabor Juhos
2012.11.25. 7:58 keltezéssel, Paul Fertser írta:
> Commit 7c8edac25f23c4fc14239fdc293caa1317649944 introduced new machine and
> Makefile changes to build images for this target. However, without the 
> userspace
> bits a ramips machine can't use wifi as the necessary "eeprom" data is to be
> extracted by a hotplug script; also, sysupgrade support and default led
> configuration are missing.
> 
> An IRC user reported these changes allowed him to use wifi on his hardware.
> 
> Signed-off-by: Paul Fertser 

Applied.

Thanks,
Gabor
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ramips: ramips_eth: use Kconfig definition to enable debug

2012-11-25 Thread Gabor Juhos
2012.11.25. 8:05 keltezéssel, Paul Fertser írta:
> The Kconfig identifier to enable debugging in the driver was different from 
> the
> actually used one. Fix that.
> 
> Signed-off-by: Paul Fertser 

Applied.

Thanks,
Gabor
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 1/3] AA: mac80211/rt2x00: backport r34268

2012-11-25 Thread Gabor Juhos
2012.11.25. 11:49 keltezéssel, Daniel Golle írta:
> Signed-off-by: Daniel Golle 

Thanks. I have queued these patches for backport after committing them into
trunk, and recently I have committed them into the AA branch.

-Gabor
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] [package] base-files: add support for the morse LED trigger

2012-11-25 Thread Gabor Juhos
2012.11.25. 15:30 keltezéssel, Petr Viktorin írta:
>>From d38c8ab2c40f368a783684d2214ec81b3cac8e11 Mon Sep 17 00:00:00 2001
> From: Petr Viktorin 
> Date: Sun, 25 Nov 2012 14:36:03 +0100
> Subject: [PATCH] [package] base-files: add support for the morse LED trigger
> 
> Write "delay" and "message" options to their respective files,
> allowing Morse code message configuration through UCI.
> The delay (dit length) defaults to 150ms (about 8 words per minute,
> suitable for beginners).
> 
> Signed-off-by: Petr Viktorin 

Applied.

Thanks,
Gabor
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] mac80211: rt2x00: Add support for multiple AP interfaces

2012-11-25 Thread Petr Štetiar
Fixes following error:

nl80211: New interface wlan0-1 created: ifindex=38
nl80211: Add own interface ifindex 38
Could not set interface wlan0-1 flags (UP): Device or resource busy
nl80211: Remove interface ifindex=38
Failed to add BSS (BSSID=c6:93:00:zz:yy:xx)

Signed-off-by: Petr Štetiar 
---
 ...ecate-max_sta_intf-field-of-struct-rt2x00.patch |  146 ++
 ...ace-open-coded-interface-checking-with-in.patch |  162 
 2 files changed, 308 insertions(+)
 create mode 100644 
package/mac80211/patches/622-rt2x00-Deprecate-max_sta_intf-field-of-struct-rt2x00.patch
 create mode 100644 
package/mac80211/patches/623-rt2x00-Replace-open-coded-interface-checking-with-in.patch

diff --git 
a/package/mac80211/patches/622-rt2x00-Deprecate-max_sta_intf-field-of-struct-rt2x00.patch
 
b/package/mac80211/patches/622-rt2x00-Deprecate-max_sta_intf-field-of-struct-rt2x00.patch
new file mode 100644
index 000..0eb3267
--- /dev/null
+++ 
b/package/mac80211/patches/622-rt2x00-Deprecate-max_sta_intf-field-of-struct-rt2x00.patch
@@ -0,0 +1,146 @@
+From 3e4c4151e56ff367fb1487ea79134eea74104077 Mon Sep 17 00:00:00 2001
+From: Gertjan van Wingerde 
+Date: Sun, 23 Sep 2012 20:22:53 +0200
+Subject: [PATCH] rt2x00: Deprecate max_sta_intf field of struct rt2x00_ops.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+All drivers set this value to 1, so there is no need (currently) to let
+drivers set this.  Therefor, remove the field; we can always add it back when
+it is needed.
+
+Inspired by an earlier patch from Paul Fertser.
+
+Signed-off-by: Gertjan van Wingerde 
+Cc: Paul Fertser 
+Signed-off-by: John W. Linville 
+Signed-off-by: Petr Štetiar 
+---
+ drivers/net/wireless/rt2x00/rt2400pci.c |1 -
+ drivers/net/wireless/rt2x00/rt2500pci.c |1 -
+ drivers/net/wireless/rt2x00/rt2500usb.c |1 -
+ drivers/net/wireless/rt2x00/rt2800pci.c |1 -
+ drivers/net/wireless/rt2x00/rt2800usb.c |1 -
+ drivers/net/wireless/rt2x00/rt2x00.h|1 -
+ drivers/net/wireless/rt2x00/rt2x00mac.c |5 ++---
+ drivers/net/wireless/rt2x00/rt61pci.c   |1 -
+ drivers/net/wireless/rt2x00/rt73usb.c   |1 -
+ 9 files changed, 2 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c 
b/drivers/net/wireless/rt2x00/rt2400pci.c
+index 6458ab8..e3a2d90 100644
+--- a/drivers/net/wireless/rt2x00/rt2400pci.c
 b/drivers/net/wireless/rt2x00/rt2400pci.c
+@@ -1789,7 +1789,6 @@ static const struct data_queue_desc rt2400pci_queue_atim 
= {
+ 
+ static const struct rt2x00_ops rt2400pci_ops = {
+   .name   = KBUILD_MODNAME,
+-  .max_sta_intf   = 1,
+   .max_ap_intf= 1,
+   .eeprom_size= EEPROM_SIZE,
+   .rf_size= RF_SIZE,
+diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c 
b/drivers/net/wireless/rt2x00/rt2500pci.c
+index 68bca14..479d756 100644
+--- a/drivers/net/wireless/rt2x00/rt2500pci.c
 b/drivers/net/wireless/rt2x00/rt2500pci.c
+@@ -2081,7 +2081,6 @@ static const struct data_queue_desc rt2500pci_queue_atim 
= {
+ 
+ static const struct rt2x00_ops rt2500pci_ops = {
+   .name   = KBUILD_MODNAME,
+-  .max_sta_intf   = 1,
+   .max_ap_intf= 1,
+   .eeprom_size= EEPROM_SIZE,
+   .rf_size= RF_SIZE,
+diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c 
b/drivers/net/wireless/rt2x00/rt2500usb.c
+index daf8579..50dfd1c 100644
+--- a/drivers/net/wireless/rt2x00/rt2500usb.c
 b/drivers/net/wireless/rt2x00/rt2500usb.c
+@@ -1896,7 +1896,6 @@ static const struct data_queue_desc rt2500usb_queue_atim 
= {
+ 
+ static const struct rt2x00_ops rt2500usb_ops = {
+   .name   = KBUILD_MODNAME,
+-  .max_sta_intf   = 1,
+   .max_ap_intf= 1,
+   .eeprom_size= EEPROM_SIZE,
+   .rf_size= RF_SIZE,
+diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c 
b/drivers/net/wireless/rt2x00/rt2800pci.c
+index 885e10e..08262fa 100644
+--- a/drivers/net/wireless/rt2x00/rt2800pci.c
 b/drivers/net/wireless/rt2x00/rt2800pci.c
+@@ -1094,7 +1094,6 @@ static const struct data_queue_desc rt2800pci_queue_bcn 
= {
+ static const struct rt2x00_ops rt2800pci_ops = {
+   .name   = KBUILD_MODNAME,
+   .drv_data_size  = sizeof(struct rt2800_drv_data),
+-  .max_sta_intf   = 1,
+   .max_ap_intf= 8,
+   .eeprom_size= EEPROM_SIZE,
+   .rf_size= RF_SIZE,
+diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c 
b/drivers/net/wireless/rt2x00/rt2800usb.c
+index 253083f..0283cf6 100644
+--- a/drivers/net/wireless/rt2x00/rt2800usb.c
 b/drivers/net/wireless/rt2x00/rt2800usb.c
+@@ -870,7 +870,6 @@ static const struct data_queue_desc rt2800usb_queue_bcn = {
+ static const struct rt2x00_ops rt2800usb_op

[OpenWrt-Devel] [PATCH][BCM63XX] Add Huawei HG556a support

2012-11-25 Thread Álvaro Fernández Rojas
Add Huawei EchoLife HG556a support.

Signed-off-by: Álvaro Fernández Rojas 
---
HW556 cal_data isn't located at the end of the flash near the nvram, so it 
needs updating jogo's mtd cal_data partitions detecting patch.

diff --git 
a/target/linux/brcm63xx/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom 
b/target/linux/brcm63xx/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
index 46be9d3..effbea8 100644
--- a/target/linux/brcm63xx/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
+++ b/target/linux/brcm63xx/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
@@ -31,6 +31,9 @@ board=$board_name
 case "$FIRMWARE" in
 "RT3062.eeprom" )
case $board in
+   HW556)
+   rt2x00_eeprom_extract "cal_data" 130560 272
+   ;;
*)
rt2x00_eeprom_die "board $board is not supported yet"
;;
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/network 
b/target/linux/brcm63xx/base-files/etc/uci-defaults/network
index 00914b3..5ad710a 100755
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/network
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/network
@@ -27,6 +27,7 @@ CPVA642 |\
 CT536_CT5621 |\
 D-4P-W |\
 "F@ST2604" |\
+HW556 |\
 NB6 |\
 SPW303V |\
 SPW500V |\
diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh 
b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
index 18df042..582c87d 100755
--- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
+++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
@@ -56,6 +56,11 @@ brcm63xx_detect() {
brcm63xx_has_reset_button="true"
ifname=eth1
;;
+   HW556)
+   status_led="HW556:red:power"
+   brcm63xx_has_reset_button="true"
+   ifname=eth0
+   ;;
96348GW-11)
status_led="power"
brcm63xx_has_reset_button="true"
diff --git a/target/linux/brcm63xx/image/Makefile 
b/target/linux/brcm63xx/image/Makefile
index 99dc8c5..af8893f 100755
--- a/target/linux/brcm63xx/image/Makefile
+++ b/target/linux/brcm63xx/image/Makefile
@@ -60,6 +60,15 @@ define Image/Build/CFEHW553
--block-size 0x2 --image-offset $(4)
 endef
 
+define Image/Build/CFEHW556
+   # Generate the tagged image
+   $(STAGING_DIR_HOST)/bin/imagetag -i $(KDIR)/vmlinux.lzma.cfe -f 
$(KDIR)/root.$(1) \
+   --output $(BIN_DIR)/openwrt-$(2)-$(1)-cfe.bin \
+   --boardid $(2) --chipid $(3) --entry $(LOADADDR) \
+   --load-addr $(LOADADDR) --tag-version 8 --rsa-signature "$(5)" \
+   --image-offset $(4) --info1 "$(6)" --block-size 0x2
+endef
+
 define Image/Build/CFEAGPF
# Generate the tagged image
$(STAGING_DIR_HOST)/bin/imagetag -i $(KDIR)/vmlinux.lzma.cfe -f 
$(KDIR)/root.$(1) \
@@ -257,6 +266,8 @@ define Image/Build
 
#HW553
$(call Image/Build/CFEHW553,$(1),HW553,6358,0x2,HW553)
+   #HW556 
+   $(call 
Image/Build/CFEHW556,$(1),HW556,6358,0x2,EchoLife_HG556a,OpenWRT-$(REVISION))
 
 
# T-Com Speedport W 303V Typ B
$(call Image/Build/SPW303V,$(1),96358-502V,6358,SPW303V)
diff --git a/target/linux/brcm63xx/patches-3.3/554-board_hw556.patch 
b/target/linux/brcm63xx/patches-3.3/554-board_hw556.patch
new file mode 100644
index 000..90ab612
--- /dev/null
+++ b/target/linux/brcm63xx/patches-3.3/554-board_hw556.patch
@@ -0,0 +1,343 @@
+--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
 b/arch/mips/bcm63xx/boards/board_bcm963xx.c
+@@ -2923,6 +2923,281 @@ static struct board_info __initdata boar
+   },
+ };
+ 
++static struct board_info __initdata board_HW556_A = {
++  .name   = "HW556_A",
++  .expected_cpu_id= 0x6358,
++
++  .has_uart0  = 1,
++  .has_pci= 1,
++  .has_ohci0  = 1,
++  .has_ehci0  = 1,
++
++  .has_caldata= 1,
++  .caldata = {
++  {
++  .vendor = PCI_VENDOR_ID_RALINK,
++  .caldata_offset = 0xeffe00,
++  .slot   = 1,
++  .eeprom = "RT3062.eeprom",
++  },
++  },
++
++  .has_enet1  = 1,
++  .enet1 = {
++  .force_speed_100= 1,
++  .force_duplex_full  = 1,
++  },
++
++  .leds = {
++  {
++  .name   = "HW556:red:message",
++  .gpio   = 0,
++  .active_low = 1,
++  },
++  {
++  .name   = "HW556:red:hspa",
++  .gpio   = 1,
++  .active_low = 1,
++ 

[OpenWrt-Devel] [PATCH][BCM63XX] Fix Comtrend AR-5381u Power LED

2012-11-25 Thread Álvaro Fernández Rojas
Fix Comtrend AR-5381u Power LED.

Signed-off-by: Álvaro Fernández Rojas 
---
diff --git a/target/linux/brcm63xx/patches-3.3/532-board_96328a-1241N.patch 
b/target/linux/brcm63xx/patches-3.3/532-board_96328a-1241N.patch
index 39daedf..58a3deb 100644
--- a/target/linux/brcm63xx/patches-3.3/532-board_96328a-1241N.patch
+++ b/target/linux/brcm63xx/patches-3.3/532-board_96328a-1241N.patch
@@ -42,7 +42,7 @@
 +  .leds = {
 +  {
 +  .name   = "96328A-1241N:green:power",
-+  .gpio   = 8,
++  .gpio   = 4,
 +  .active_low = 1,
 +  .default_trigger= "default-on",
 +  },
diff --git a/target/linux/brcm63xx/patches-3.6/532-board_96328a-1241N.patch 
b/target/linux/brcm63xx/patches-3.6/532-board_96328a-1241N.patch
index 39daedf..58a3deb 100644
--- a/target/linux/brcm63xx/patches-3.6/532-board_96328a-1241N.patch
+++ b/target/linux/brcm63xx/patches-3.6/532-board_96328a-1241N.patch
@@ -42,7 +42,7 @@
 +  .leds = {
 +  {
 +  .name   = "96328A-1241N:green:power",
-+  .gpio   = 8,
++  .gpio   = 4,
 +  .active_low = 1,
 +  .default_trigger= "default-on",
 +  },
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel