[OpenWrt-Devel] Buying a DIR-825-C1

2013-03-18 Thread Alexander Stadler
Hi!

As I have added support for the D-Link Dir-825 Rev. C1 it would be nice to have 
one (and propably add the switch leds).. .
Unfortunately its not avalaible here. Most (internet) stores are too bad to 
know which revision they sell, even its printed on a sticker on the outside of 
the box. But seems like only revision B2 is avalaible in Europe.
And most US shops don't ship outside the States.. . So I found none. Had good 
experiences with ncix from Canada, but they also don't have it. (They would 
even be fast enough for shipping to me till the weekend.)

So my question is if there is anyone who would feel okay too buy one for me 
where its avalaible and also send it?

Thanks

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


Re: [OpenWrt-Devel] c question (for a patch..)

2013-03-08 Thread Alexander Stadler
Hi!

"Discussed topic" already went into the patch and works, so thanks for 
communication and verification!

Am 08.03.2013 13:48, schrieb Tijs Van Buggenhout:

> 
> As long as the intension is not data protection, const can be useful ;-)
> 

Just protection from the programmer ;-).

> Tijs

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


[OpenWrt-Devel] [PATCH v2 001/003] [ar71xx] add kernel support for dir-835-a1

2013-03-07 Thread Alexander Stadler
From: Alexander Stadler 

kernel support for dir-835-a1

Signed-off-by: Alexander Stadler 
---
support implemented within the mach-dir-825-c1.c like requested
diff -urN a/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-825-c1.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-825-c1.c
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-825-c1.c   
2013-03-05 17:54:10.0 +0100
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-825-c1.c   
2013-03-07 17:42:36.0 +0100
@@ -79,6 +79,34 @@
},
 };
 
+static struct gpio_led dir835a1_leds_gpio[] __initdata = {
+   {
+   .name   = "d-link:orange:power",
+   .gpio   = DIR825C1_GPIO_LED_ORANGE_POWER,
+   .active_low = 1,
+   },
+   {
+   .name   = "d-link:green:power",
+   .gpio   = DIR825C1_GPIO_LED_BLUE_POWER,
+   .active_low = 1,
+   },
+   {
+   .name   = "d-link:blue:wps",
+   .gpio   = DIR825C1_GPIO_LED_BLUE_WPS,
+   .active_low = 1,
+   },
+   {
+   .name   = "d-link:orange:planet",
+   .gpio   = DIR825C1_GPIO_LED_ORANGE_PLANET,
+   .active_low = 1,
+   },
+   {
+   .name   = "d-link:green:planet",
+   .gpio   = DIR825C1_GPIO_LED_BLUE_PLANET,
+   .active_low = 1,
+   },
+};
+
 static struct gpio_keys_button dir825c1_gpio_keys[] __initdata = {
{
.desc   = "reset",
@@ -126,6 +154,17 @@
.led_cfg = &dir825c1_ar8327_led_cfg,
 };
 
+static struct ar8327_platform_data dir835a1_ar8327_data = {
+   .pad0_cfg = &dir825c1_ar8327_pad0_cfg,
+   .port0_cfg = {
+   .force_link = 1,
+   .speed = AR8327_PORT_SPEED_1000,
+   .duplex = 1,
+   .txpause = 1,
+   .rxpause = 1,
+   },
+};
+
 static struct mdio_board_info dir825c1_mdio0_info[] = {
{
.bus_id = "ag71xx-mdio.0",
@@ -134,6 +173,14 @@
},
 };
 
+static struct mdio_board_info dir835a1_mdio0_info[] = {
+   {
+   .bus_id = "ag71xx-mdio.0",
+   .phy_addr = 0,
+   .platform_data = &dir835a1_ar8327_data,
+   },
+};
+
 static void dir825c1_read_ascii_mac(u8 *dest, u8 *src)
 {
int ret;
@@ -146,7 +193,9 @@
memset(dest, 0, ETH_ALEN);
 }
 
-static void __init dir825c1_setup(void)
+static void __init dir825c1_generic_setup(struct gpio_led *const leds_gpio, 
size_t leds_gpio_size,
+ struct gpio_keys_button *const 
gpio_keys, size_t gpio_keys_size,
+ struct mdio_board_info *const 
mdio0_info, size_t mdio0_info_size)
 {
u8 *mac = (u8 *) KSEG1ADDR(0x1ffe);
u8 *art = (u8 *) KSEG1ADDR(0x1fff);
@@ -156,18 +205,13 @@
dir825c1_read_ascii_mac(mac0, mac + DIR825C1_MAC0_OFFSET);
dir825c1_read_ascii_mac(mac1, mac + DIR825C1_MAC1_OFFSET);
 
-   ath79_gpio_output_select(DIR825C1_GPIO_LED_BLUE_USB, 
AR934X_GPIO_OUT_GPIO);
-
ath79_register_m25p80(NULL);
 
-   ath79_register_leds_gpio(-1, ARRAY_SIZE(dir825c1_leds_gpio),
-dir825c1_leds_gpio);
+   ath79_register_leds_gpio(-1, leds_gpio_size,
+leds_gpio);
ath79_register_gpio_keys_polled(-1, DIR825C1_KEYS_POLL_INTERVAL,
-   ARRAY_SIZE(dir825c1_gpio_keys),
-   dir825c1_gpio_keys);
-
-   ap9x_pci_setup_wmac_led_pin(0, 13);
-   ap9x_pci_setup_wmac_led_pin(1, 32);
+   gpio_keys_size,
+   gpio_keys);
 
ath79_init_mac(wmac0, mac0, 0);
ath79_register_wmac(art + DIR825C1_WMAC_CALDATA_OFFSET, wmac0);
@@ -177,8 +221,8 @@
 
ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0);
 
-   mdiobus_register_board_info(dir825c1_mdio0_info,
-   ARRAY_SIZE(dir825c1_mdio0_info));
+   mdiobus_register_board_info(mdio0_info,
+   mdio0_info_size);
 
ath79_register_mdio(0, 0x0);
 
@@ -194,6 +238,29 @@
ath79_register_usb();
 }
 
+static void __init dir825c1_setup(void)
+{
+   ath79_gpio_output_select(DIR825C1_GPIO_LED_BLUE_USB, 
AR934X_GPIO_OUT_GPIO);
+
+   ap9x_pci_setup_wmac_led_pin(0, 13);
+   ap9x_pci_setup_wmac_led_pin(1, 32);
+
+   
dir825c1_generic_setup(dir825c1_leds_gpio,ARRAY_SIZE(dir825c1_leds_gpio),
+  
dir825c1_gpio_keys,ARRAY_SIZE(dir825c1_gpio_keys),
+  
dir825c1_mdio0_info,ARRAY_SIZE(dir825c1_mdio0_info));
+}
+
+s

[OpenWrt-Devel] [PATCH v2 002/003] [ar71xx] add user space support for dir-835-a1

2013-03-07 Thread Alexander Stadler
From: Alexander Stadler 

user space support for dir-835-a1

Signed-off-by: Alexander Stadler 
---
support implemented within the mach-dir-825-c1.c like requested
diff -urN a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
--- a/target/linux/ar71xx/base-files/etc/diag.sh2013-03-05 
17:53:43.0 +0100
+++ b/target/linux/ar71xx/base-files/etc/diag.sh2013-03-05 
18:27:51.0 +0100
@@ -50,7 +50,8 @@
dir-615-c1)
status_led="d-link:green:status"
;;
-   dir-825-b1)
+   dir-825-b1 |\
+   dir-835-a1)
status_led="d-link:orange:power"
;;
dir-825-c1)
diff -urN a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 
b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds   2013-03-05 
17:53:43.0 +0100
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds   2013-03-05 
18:37:54.0 +0100
@@ -60,10 +60,7 @@
ucidef_set_led_switch "lan4" "LAN4" "d-link:green:lan4" "switch0" "0x10"
;;
 
-dir-825-b1)
-   ucidef_set_led_usbdev "usb" "USB" "d-link:blue:usb" "1-1"
-   ;;
-
+dir-825-b1 | \
 dir-825-c1)
ucidef_set_led_usbdev "usb" "USB" "d-link:blue:usb" "1-1"
;;
diff -urN a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
2013-03-05 17:53:43.0 +0100
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
2013-03-05 18:32:30.0 +0100
@@ -175,7 +175,8 @@
ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
;;
 
-dir-825-c1|\
+dir-825-c1 |\
+dir-835-a1 |\
 wndr4300)
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
ucidef_add_switch "switch0" "1" "1"
diff -urN a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh  2013-03-05 
17:53:43.0 +0100
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh  2013-03-05 
18:42:12.0 +0100
@@ -225,6 +225,9 @@
*"DIR-825 rev. C1")
name="dir-825-c1"
;;
+   *"DIR-835 rev. A1")
+   name="dir-835-a1"
+   ;;
*EAP7660D)
name="eap7660d"
;;
diff -urN a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh2013-02-24 
18:43:51.0 +0100
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh2013-02-24 
18:53:07.0 +0100
@@ -109,6 +109,7 @@
dir-615-c1 | \
dir-615-e4 | \
dir-825-c1 | \
+   dir-835-a1 | \
ew-dorin | \
ew-dorin-router | \
mzk-w04nu | \
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2 003/003] [ar71xx] add profile support for dir-835-a1

2013-03-07 Thread Alexander Stadler
From: Alexander Stadler 

profile support for dir-835-a1

Signed-off-by: Alexander Stadler 
---
support implemented within the mach-dir-825-c1.c like requested
diff -urN a/target/linux/ar71xx/generic/profiles/d-link.mk 
b/target/linux/ar71xx/generic/profiles/d-link.mk
--- a/target/linux/ar71xx/generic/profiles/d-link.mk2013-02-24 
18:43:51.0 +0100
+++ b/target/linux/ar71xx/generic/profiles/d-link.mk2013-02-24 
18:55:12.0 +0100
@@ -72,3 +72,14 @@
 endef
 
 $(eval $(call Profile,DIR825C1))
+
+define Profile/DIR835A1
+   NAME:=D-Link DIR-835 rev. A1
+   PACKAGES:=kmod-usb-core kmod-usb2
+endef
+
+define Profile/DIR835A1/Description
+   Package set optimized for the D-Link DIR-835 rev. A1.
+endef
+
+$(eval $(call Profile,DIR835A1))
diff -urN a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
--- a/target/linux/ar71xx/image/Makefile2013-03-05 17:53:43.0 
+0100
+++ b/target/linux/ar71xx/image/Makefile2013-03-05 19:49:38.0 
+0100
@@ -859,6 +859,7 @@
 $(eval $(call 
SingleProfile,Cameo933x,$(fs_squash),TEW712BR,tew-712br,TEW-712BR,ttyATH0,115200,"HORNET-RT-TEW712BR-3"))
 
 $(eval $(call 
SingleProfile,Cameo934x,$(fs_64k),DIR825C1,dir-825-c1,DIR-825-C1,ttyS0,115200,"00DB120AR9344-RT-101214-00"))
+$(eval $(call 
SingleProfile,Cameo934x,$(fs_64k),DIR835A1,dir-835-a1,DIR-835-A1,ttyS0,115200,"00DB120AR9344-RT-101214-00"))
 
 $(eval $(call 
SingleProfile,CyberTAN,$(fs_64k),WRT160NL,wrt160nl,WRT160NL,ttyS0,115200,1.00.01))
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] c question (for a patch..)

2013-03-07 Thread Alexander Stadler
Am 07.03.2013 17:25, schrieb Tijs Van Buggenhout:
> On Thursday 07 March 2013 16:39:33 Alexander Stadler wrote:
>> Am 07.03.2013 16:24, schrieb Matthijs Kooijman:
>>> Hi Alexander,

Hi Tijs,
just read after I've sent my last Message.. .

>>>
>>>> The next thought was that ARRAY_SIZE macro must get an array and not
>>>
>>>> an pointer, so I tried it with:
>>> That's exactly right. An array's size is not stored in memory, so you
>>> can only get at it at compile time. However, then you must actually pass
>>> the array, not a pointer to the array (which could potentially point to
>>> different arrays).
>>>
>>>> static void __init board_generic_setup(struct gpio_led *leds_gpio, size_t
>>>> leds_gpio_size, struct gpio_keys_button *gpio_keys, size_t
>>>> gpio_keys_size, struct mdio_board_info *mdio0_info, size_t
>>>> mdio0_info_size)
>>>>
>>>> board_generic_setup(board_leds_gpio,ARRAY_SIZE(board_leds_gpio),board_gpi
>>>> o_keys,ARRAY_SIZE(board_gpio_keys),board_mdio0_info,ARRAY_SIZE(board_mdio
>>>> 0_info));
>> And no const(s)? I'm a bit confused because mdio_board_info seems to use
>> const struct but ath79_register_leds_gpio does not.
> 
> In general it's good to inform/promise the compiler when the program is not 
> going to change data (using const). However, you'll have to adjust to the 
> function definition types of the other functions that you are going to use in 
> your new function. When compiled with the appropriate flags, when passing a 
> const pointer

As I understand the "struct gpio_led *leds_gpio" syntax was a pointer to a 
const struct, and not to a const pointer.
So that should give warnings after used with functions where its defined 
non-const, because they would be able to modify the content of the struct.

But as written in the other mail I now use "struct gpio_led *const leds_gpio".
This should not throw errors (I think because in the next function its a new 
pointer, so which then could again be used to point to an other address?), as 
long as (in this function) the pointer is not used to point to another struct 
(which is exactly what I want to prevent.)

to a function as argument, which is by definition typed non-
> const, it should produce a warning/error. The latter can be avoided by 
> casting 
> the const away, but what's the point in that...
> 
> This might be interesting reading 
> http://publications.gbdirect.co.uk/c_book/chapter8/const_and_volatile.html.
> 
>>> This would indeed be a sane way to handle this.
>>>
>>>> No problems to expect from the functions like ath79_register_leds_gpio
>>>> when getting the pointer instead the array?
>>>
>>> This should work, since that function also has a size parameter (for the
>>> same reason).
>>
>> The functions use unsigned for the size parameter, not size_t. But I think
>> "my" ARRAY_SIZE will return size_t and so this will be the better approach?
> 
> size_t is intended to represent memory related quantities, and is preferred 
> in 
> that regard.
> 
>>> Gr.
>>>
>>> Matthijs
>>
>> Thanks
>>
>> Alex
> 
> Regards,
> Tijs

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


Re: [OpenWrt-Devel] c question (for a patch..)

2013-03-07 Thread Alexander Stadler
Am 07.03.2013 17:01, schrieb Matthijs Kooijman:
> Hi Alexander,
> 
 static void __init board_generic_setup(struct gpio_led *leds_gpio, size_t 
 leds_gpio_size, struct gpio_keys_button *gpio_keys, size_t gpio_keys_size, 
 struct mdio_board_info *mdio0_info, size_t mdio0_info_size)

 board_generic_setup(board_leds_gpio,ARRAY_SIZE(board_leds_gpio),board_gpio_keys,ARRAY_SIZE(board_gpio_keys),board_mdio0_info,ARRAY_SIZE(board_mdio0_info));
>>
>> And no const(s)? I'm a bit confused because mdio_board_info seems to
>> use const struct but ath79_register_leds_gpio does not.
> I guess it's a good idea to use const when possible, but it's probably
> not used everywhere since it doesn't break without const. So you would
> e.g., use:
> 
>   static void __init board_generic_setup(const struct gpio_led 
> *leds_gpio, size_t leds_gpio_size, etc..
> 
> to let callers (and the compiler) know that you wont be changing
> anything in the struct(s) leds_gpio points to.

I've ended up with using
static void __init board_generic_setup(struct gpio_led *const leds_gpio, size_t 
leds_gpio_size, etc..
as in the original code you would be able to change values in the struct, even 
it's not done for those.
But you definitely don't want to point to another struct with it.

> 
>> The functions use unsigned for the size parameter, not size_t. But I
>> think "my" ARRAY_SIZE will return size_t and so this will be the
>> better approach?
> 
> size_t and unsigned are similar (and for small arrays, any unsigned type
> will usually suffice). However, size_t is a type that is guaranteed to
> hold the size of any object, so it seems more appropriate here.
> 
> Gr.
> 
> Matthijs

Thanks for your fast response, so I can commit the patch today :-).

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


Re: [OpenWrt-Devel] c question (for a patch..)

2013-03-07 Thread Alexander Stadler
Am 07.03.2013 16:24, schrieb Matthijs Kooijman:
> Hi Alexander,
> 
>> The next thought was that ARRAY_SIZE macro must get an array and not
>> an pointer, so I tried it with:
> That's exactly right. An array's size is not stored in memory, so you
> can only get at it at compile time. However, then you must actually pass
> the array, not a pointer to the array (which could potentially point to
> different arrays).
> 
>> static void __init board_generic_setup(struct gpio_led *leds_gpio, size_t 
>> leds_gpio_size, struct gpio_keys_button *gpio_keys, size_t gpio_keys_size, 
>> struct mdio_board_info *mdio0_info, size_t mdio0_info_size)
>>
>> board_generic_setup(board_leds_gpio,ARRAY_SIZE(board_leds_gpio),board_gpio_keys,ARRAY_SIZE(board_gpio_keys),board_mdio0_info,ARRAY_SIZE(board_mdio0_info));

And no const(s)? I'm a bit confused because mdio_board_info seems to use const 
struct but ath79_register_leds_gpio does not.

> 
> This would indeed be a sane way to handle this.
> 
>> No problems to expect from the functions like ath79_register_leds_gpio
>> when getting the pointer instead the array?
> This should work, since that function also has a size parameter (for the
> same reason).

The functions use unsigned for the size parameter, not size_t. But I think "my" 
ARRAY_SIZE will return size_t and so this will be the better approach?

> 
> Gr.
> 
> Matthijs

Thanks

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


[OpenWrt-Devel] c question (for a patch..)

2013-03-07 Thread Alexander Stadler
Hi!

Haven't developed for many years, and I unfortunately see the effects ;-).
Can someone please help me with a short question?
After that I can finish a patch.. .

I have i.e.:

static struct gpio_led board_leds_gpio[] __initdata = {
{
.name   = "board:power",
.gpio   = BOARD_GPIO_LED_POWER,
.active_low = 1,
},
};

static struct mdio_board_info board_mdio0_info[] = {
{
.bus_id = "ag71xx-mdio.0",
.phy_addr = 0,
.platform_data = &board_ar8327_data,
},
};

--

that was used like:

static void __init board_setup(void)
{
ath79_register_leds_gpio(-1, ARRAY_SIZE(board_leds_gpio),
 board_leds_gpio);

mdiobus_register_board_info(board_mdio0_info,
ARRAY_SIZE(board_mdio0_info));
}

--

now i want to use it this way:

static void __init board_setup(void)
{
board_generic_setup(board_leds_gpio,board_gpio_keys,board_mdio0_info);
}

static void __init board_generic_setup(struct gpio_led *leds_gpio, struct 
gpio_keys_button *gpio_keys, struct mdio_board_info *mdio0_info)
{
ath79_register_leds_gpio(-1, ARRAY_SIZE(leds_gpio),
 leds_gpio);
mdiobus_register_board_info(mdio0_info,
ARRAY_SIZE(mdio0_info));
}

--

I think you get what I want to do?

But something has to be wrong with that, as the compiler throws the error: 
negative width in bit-field 'anonymous' (for every line with ARRAY_SIZE..).

(Search engines and some other .c files didn't get me further except sometimes 
they use i.e. "static void __init board_generic_setup(struct gpio_led * const 
leds_gpio", or "const struct gpio_led *leds_gpio", so should I use a const too?)

--

The next thought was that ARRAY_SIZE macro must get an array and not an 
pointer, so I tried it with:

static void __init board_generic_setup(struct gpio_led *leds_gpio, size_t 
leds_gpio_size, struct gpio_keys_button *gpio_keys, size_t gpio_keys_size, 
struct mdio_board_info *mdio0_info, size_t mdio0_info_size)

board_generic_setup(board_leds_gpio,ARRAY_SIZE(board_leds_gpio),board_gpio_keys,ARRAY_SIZE(board_gpio_keys),board_mdio0_info,ARRAY_SIZE(board_mdio0_info));

Which compiles!

Is this the correct way now?
Any better Ideas?
No problems to expect from the functions like ath79_register_leds_gpio when 
getting the pointer instead the array?

--

Thanks

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


Re: [OpenWrt-Devel] [PATCH 001/003] [ar71xx] add kernel support for dir-835-a1

2013-03-04 Thread Alexander Stadler
Am 04.03.2013 14:56, schrieb Gabor Juhos:
> Hi Alex,
> 
>> I also thought on this for a moment.
>> But:
>> I found no examples which did this like it shoud be done here. But could be 
>> that I've overseen such one.
>> The leds have different colors so names so the struct gpio_led will be
>> different (besides fewer leds in general..). To not get confused about the 
>> names
>> (which include color..) also the defines for them could or should be 
>> additional
>> ones.
>> Having two structs for the leds, two dirxxx_setup's with the different
>> ath79_register_leds_gpio calls, and to be exact without the usb led and 
>> switch
>> leds (so a second different struct) didn't seem a small change for the .c 
>> file.
>> More like two of them done in one.
>> After that, I thought its more straightforward to make an own one. Don't u
>> think so too?>
> 
> Adding another structure with five LEDs is not a big deal. Alternatively the 
> LED
> names can be changed from the setup routine. For the switch LED configuration,
> you don't need another structure. Simply set the led_cfg field to NULL.
> 
>> Else, how have the
>> MIPS_MACHINE(ATH79_MACH_DIR_835_A1, "DIR-835-A1",
>>   "D-Link DIR-835 rev. A1",
>>   dir835a1_setup);
>> part(s) to look like in the 825-c1.c to be able to decide which function to 
>> call for each model? And this will be enough?
> 
> You can create a common setup function for the generic parts and then call 
> that
> from the model specific setup routine. See how it is done in the
> 'mach-tl-mr3x20.c' and in the 'mach-rb4xx.c' files for example.
> 
> -Gabor

So as far as I can see the name needs to be generalized in
target/linux/ar71xx/config-3.7
(in target/linux/ar71xx/patches-3.7/6xx-MIPS-ath79-add-)
arch/mips/ath79/Kconfig
arch/mips/ath79/Makefile
and could stay splitted like it is for the rest?

But I still don't really see the benefit of this added complexity.. .
As I also could say all db120's should go into one .c .

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


Re: [OpenWrt-Devel] [PATCH 001/003] [ar71xx] add kernel support for dir-835-a1

2013-03-04 Thread Alexander Stadler
03.03.2013 13:58, schrieb Gabor Juhos:
> 2013.02.27. 12:49 keltezéssel, Alexander Stadler írta:
>> From: Alexander Stadler 
>>
>> kernel support for dir-835-a1
>>
>> Signed-off-by: Alexander Stadler 
>> ---
>> diff -urN a/target/linux/ar71xx/config-3.7 b/target/linux/ar71xx/config-3.7
>> --- a/target/linux/ar71xx/config-3.7 2013-02-24 18:43:51.0 +0100
>> +++ b/target/linux/ar71xx/config-3.7 2013-02-24 18:47:45.0 +0100
>> @@ -40,6 +40,7 @@
>>  CONFIG_ATH79_MACH_DIR_615_C1=y
>>  CONFIG_ATH79_MACH_DIR_825_B1=y
>>  CONFIG_ATH79_MACH_DIR_825_C1=y
>> +CONFIG_ATH79_MACH_DIR_835_A1=y
>>  CONFIG_ATH79_MACH_EAP7660D=y
>>  CONFIG_ATH79_MACH_EW_DORIN=y
>>  CONFIG_ATH79_MACH_HORNET_UB=y
>> diff -urN a/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-835-a1.c 
>> b/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-835-a1.c
>> --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-835-a1.c
>> 1970-01-01 01:00:00.0 +0100
>> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-835-a1.c
>> 2013-02-24 18:46:24.0 +0100
>> @@ -0,0 +1,179 @@
>> +/*
>> + *  D-Link DIR-835 rev. A1 board support
>> + *
>> + *  Copyright (C) 2013 Alexander Stadler
>> + *
>> + *  This program is free software; you can redistribute it and/or modify it
>> + *  under the terms of the GNU General Public License version 2 as published
>> + *  by the Free Software Foundation.
>> + */
>> +
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +
>> +#include 
>> +
>> +#include "common.h"
>> +#include "dev-ap9x-pci.h"
>> +#include "dev-eth.h"
>> +#include "dev-gpio-buttons.h"
>> +#include "dev-leds-gpio.h"
>> +#include "dev-m25p80.h"
>> +#include "dev-spi.h"
>> +#include "dev-usb.h"
>> +#include "dev-wmac.h"
>> +#include "machtypes.h"
>> +
>> +#define DIR835A1_GPIO_LED_ORANGE_POWER  14
>> +#define DIR835A1_GPIO_LED_GREEN_POWER   22
>> +#define DIR835A1_GPIO_LED_BLUE_WPS  15
>> +#define DIR835A1_GPIO_LED_ORANGE_PLANET 19
>> +#define DIR835A1_GPIO_LED_GREEN_PLANET  18
>> +
>> +#define DIR835A1_GPIO_BTN_RESET 17
>> +#define DIR835A1_GPIO_BTN_WPS   16
>> +
>> +#define DIR835A1_KEYS_POLL_INTERVAL 20  /* msecs */
>> +#define DIR835A1_KEYS_DEBOUNCE_INTERVAL (3 * 
>> DIR835A1_KEYS_POLL_INTERVAL)
>> +
>> +#define DIR835A1_MAC0_OFFSET0x4
>> +#define DIR835A1_MAC1_OFFSET0x18
>> +#define DIR835A1_WMAC_CALDATA_OFFSET0x1000
>> +#define DIR835A1_PCIE_CALDATA_OFFSET0x5000
>> +
>> +static struct gpio_led dir835a1_leds_gpio[] __initdata = {
>> +{
>> +.name   = "d-link:orange:power",
>> +.gpio   = DIR835A1_GPIO_LED_ORANGE_POWER,
>> +.active_low = 1,
>> +},
>> +{
>> +.name   = "d-link:green:power",
>> +.gpio   = DIR835A1_GPIO_LED_GREEN_POWER,
>> +.active_low = 1,
>> +},
>> +{
>> +.name   = "d-link:blue:wps",
>> +.gpio   = DIR835A1_GPIO_LED_BLUE_WPS,
>> +.active_low = 1,
>> +},
>> +{
>> +.name   = "d-link:orange:planet",
>> +.gpio   = DIR835A1_GPIO_LED_ORANGE_PLANET,
>> +.active_low = 1,
>> +},
>> +{
>> +.name   = "d-link:green:planet",
>> +.gpio   = DIR835A1_GPIO_LED_GREEN_PLANET,
>> +.active_low = 1,
>> +},
>> +};
>> +
>> +static struct gpio_keys_button dir835a1_gpio_keys[] __initdata = {
>> +{
>> +.desc   = "reset",
>> +.type   = EV_KEY,
>> +.code   = KEY_RESTART,
>> +.debounce_interval = DIR835A1_KEYS_DEBOUNCE_INTERVAL,
>> +.gpio   = DIR835A1_GPIO_BTN_RESET,
>> +.active_low = 1,
>> +},
>> +{
>> +.desc   = "wps",
>> +.type   = EV_KEY,
>> +.code   = KEY_WPS_B

[OpenWrt-Devel] [PATCH 002/003] [ar71xx] add user space support for dir-835-a1

2013-02-27 Thread Alexander Stadler
From: Alexander Stadler 

user space support for dir-835-a1

Signed-off-by: Alexander Stadler 
---
diff -urN a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
--- a/target/linux/ar71xx/base-files/etc/diag.sh2013-02-24 
18:43:51.0 +0100
+++ b/target/linux/ar71xx/base-files/etc/diag.sh2013-02-24 
18:48:29.0 +0100
@@ -56,6 +56,9 @@
dir-825-c1)
status_led="d-link:orange:power"
;;
+   dir-835-a1)
+   status_led="d-link:orange:power"
+   ;;
eap7660d)
status_led="eap7660d:green:ds4"
;;
diff -urN a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
2013-02-24 18:43:51.0 +0100
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
2013-02-24 18:51:27.0 +0100
@@ -176,6 +176,7 @@
;;
 
 dir-825-c1|\
+dir-835-a1|\
 wndr4300)
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
ucidef_add_switch "switch0" "1" "1"
diff -urN a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh  2013-02-24 
18:43:51.0 +0100
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh  2013-02-24 
18:48:29.0 +0100
@@ -222,6 +222,9 @@
*"DIR-825 rev. C1")
name="dir-825-c1"
;;
+   *"DIR-835 rev. A1")
+   name="dir-835-a1"
+   ;;
*EAP7660D)
name="eap7660d"
;;
diff -urN a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh2013-02-24 
18:43:51.0 +0100
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh2013-02-24 
18:53:07.0 +0100
@@ -109,6 +109,7 @@
dir-615-c1 | \
dir-615-e4 | \
dir-825-c1 | \
+   dir-835-a1 | \
ew-dorin | \
ew-dorin-router | \
mzk-w04nu | \
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 001/003] [ar71xx] add kernel support for dir-835-a1

2013-02-27 Thread Alexander Stadler
From: Alexander Stadler 

kernel support for dir-835-a1

Signed-off-by: Alexander Stadler 
---
diff -urN a/target/linux/ar71xx/config-3.7 b/target/linux/ar71xx/config-3.7
--- a/target/linux/ar71xx/config-3.72013-02-24 18:43:51.0 +0100
+++ b/target/linux/ar71xx/config-3.72013-02-24 18:47:45.0 +0100
@@ -40,6 +40,7 @@
 CONFIG_ATH79_MACH_DIR_615_C1=y
 CONFIG_ATH79_MACH_DIR_825_B1=y
 CONFIG_ATH79_MACH_DIR_825_C1=y
+CONFIG_ATH79_MACH_DIR_835_A1=y
 CONFIG_ATH79_MACH_EAP7660D=y
 CONFIG_ATH79_MACH_EW_DORIN=y
 CONFIG_ATH79_MACH_HORNET_UB=y
diff -urN a/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-835-a1.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-835-a1.c
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-835-a1.c   
1970-01-01 01:00:00.0 +0100
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-835-a1.c   
2013-02-24 18:46:24.0 +0100
@@ -0,0 +1,179 @@
+/*
+ *  D-Link DIR-835 rev. A1 board support
+ *
+ *  Copyright (C) 2013 Alexander Stadler
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include "common.h"
+#include "dev-ap9x-pci.h"
+#include "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-spi.h"
+#include "dev-usb.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+
+#define DIR835A1_GPIO_LED_ORANGE_POWER 14
+#define DIR835A1_GPIO_LED_GREEN_POWER  22
+#define DIR835A1_GPIO_LED_BLUE_WPS 15
+#define DIR835A1_GPIO_LED_ORANGE_PLANET19
+#define DIR835A1_GPIO_LED_GREEN_PLANET 18
+
+#define DIR835A1_GPIO_BTN_RESET17
+#define DIR835A1_GPIO_BTN_WPS  16
+
+#define DIR835A1_KEYS_POLL_INTERVAL20  /* msecs */
+#define DIR835A1_KEYS_DEBOUNCE_INTERVAL(3 * 
DIR835A1_KEYS_POLL_INTERVAL)
+
+#define DIR835A1_MAC0_OFFSET   0x4
+#define DIR835A1_MAC1_OFFSET   0x18
+#define DIR835A1_WMAC_CALDATA_OFFSET   0x1000
+#define DIR835A1_PCIE_CALDATA_OFFSET   0x5000
+
+static struct gpio_led dir835a1_leds_gpio[] __initdata = {
+   {
+   .name   = "d-link:orange:power",
+   .gpio   = DIR835A1_GPIO_LED_ORANGE_POWER,
+   .active_low = 1,
+   },
+   {
+   .name   = "d-link:green:power",
+   .gpio   = DIR835A1_GPIO_LED_GREEN_POWER,
+   .active_low = 1,
+   },
+   {
+   .name   = "d-link:blue:wps",
+   .gpio   = DIR835A1_GPIO_LED_BLUE_WPS,
+   .active_low = 1,
+   },
+   {
+   .name   = "d-link:orange:planet",
+   .gpio   = DIR835A1_GPIO_LED_ORANGE_PLANET,
+   .active_low = 1,
+   },
+   {
+   .name   = "d-link:green:planet",
+   .gpio   = DIR835A1_GPIO_LED_GREEN_PLANET,
+   .active_low = 1,
+   },
+};
+
+static struct gpio_keys_button dir835a1_gpio_keys[] __initdata = {
+   {
+   .desc   = "reset",
+   .type   = EV_KEY,
+   .code   = KEY_RESTART,
+   .debounce_interval = DIR835A1_KEYS_DEBOUNCE_INTERVAL,
+   .gpio   = DIR835A1_GPIO_BTN_RESET,
+   .active_low = 1,
+   },
+   {
+   .desc   = "wps",
+   .type   = EV_KEY,
+   .code   = KEY_WPS_BUTTON,
+   .debounce_interval = DIR835A1_KEYS_DEBOUNCE_INTERVAL,
+   .gpio   = DIR835A1_GPIO_BTN_WPS,
+   .active_low = 1,
+   },
+};
+
+static struct ar8327_pad_cfg dir835a1_ar8327_pad0_cfg = {
+   .mode = AR8327_PAD_MAC_RGMII,
+   .txclk_delay_en = true,
+   .rxclk_delay_en = true,
+   .txclk_delay_sel = AR8327_CLK_DELAY_SEL1,
+   .rxclk_delay_sel = AR8327_CLK_DELAY_SEL2,
+};
+
+static struct ar8327_platform_data dir835a1_ar8327_data = {
+   .pad0_cfg = &dir835a1_ar8327_pad0_cfg,
+   .port0_cfg = {
+   .force_link = 1,
+   .speed = AR8327_PORT_SPEED_1000,
+   .duplex = 1,
+   .txpause = 1,
+   .rxpause = 1,
+   },
+};
+
+static struct mdio_board_info dir835a1_mdio0_info[] = {
+   {
+   .bus_id = "ag71xx-mdio.0",
+   .phy_addr = 0,
+   .platform_data = &dir835a1_ar8327_data,
+   },
+};
+
+static v

[OpenWrt-Devel] [PATCH 003/003] [ar71xx] add profile support for dir-835-a1

2013-02-27 Thread Alexander Stadler
From: Alexander Stadler 

profile support for dir-835-a1

Signed-off-by: Alexander Stadler 
---
diff -urN a/target/linux/ar71xx/generic/profiles/d-link.mk 
b/target/linux/ar71xx/generic/profiles/d-link.mk
--- a/target/linux/ar71xx/generic/profiles/d-link.mk2013-02-24 
18:43:51.0 +0100
+++ b/target/linux/ar71xx/generic/profiles/d-link.mk2013-02-24 
18:55:12.0 +0100
@@ -72,3 +72,14 @@
 endef
 
 $(eval $(call Profile,DIR825C1))
+
+define Profile/DIR835A1
+   NAME:=D-Link DIR-835 rev. A1
+   PACKAGES:=kmod-usb-core kmod-usb2 kmod-ledtrig-usbdev
+endef
+
+define Profile/DIR835A1/Description
+   Package set optimized for the D-Link DIR-835 rev. A1.
+endef
+
+$(eval $(call Profile,DIR835A1))
diff -urN a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
--- a/target/linux/ar71xx/image/Makefile2013-02-24 18:43:51.0 
+0100
+++ b/target/linux/ar71xx/image/Makefile2013-02-24 18:56:02.0 
+0100
@@ -855,6 +855,7 @@
 $(eval $(call 
SingleProfile,Cameo933x,$(fs_squash),TEW712BR,tew-712br,TEW-712BR,ttyATH0,115200,"HORNET-RT-TEW712BR-3"))
 
 $(eval $(call 
SingleProfile,Cameo934x,$(fs_64k),DIR825C1,dir-825-c1,DIR-825-C1,ttyS0,115200,"00DB120AR9344-RT-101214-00"))
+$(eval $(call 
SingleProfile,Cameo934x,$(fs_64k),DIR835A1,dir-835-a1,DIR-835-A1,ttyS0,115200,"00DB120AR9344-RT-101214-00"))
 
 $(eval $(call 
SingleProfile,CyberTAN,$(fs_64k),WRT160NL,wrt160nl,WRT160NL,ttyS0,115200,1.00.01))
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] [ar71xx] fixes leds (and updates mac assignement) for dir-825-c1

2013-02-27 Thread Alexander Stadler
From: Alexander Stadler 

fix leds (and update mac assignement) for dir-825-c1

Signed-off-by: Alexander Stadler 
---
diff -urN a/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-825-c1.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-825-c1.c
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-825-c1.c   
2013-02-25 13:25:08.0 +0100
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-825-c1.c   
2013-02-25 13:46:56.0 +0100
@@ -29,8 +29,9 @@
 #include "machtypes.h"
 
 #define DIR825C1_GPIO_LED_BLUE_USB 11
-#define DIR825C1_GPIO_LED_ORANGE_POWER 15
-#define DIR825C1_GPIO_LED_BLUE_POWER   14
+#define DIR825C1_GPIO_LED_ORANGE_POWER 14
+#define DIR825C1_GPIO_LED_BLUE_POWER   22
+#define DIR825C1_GPIO_LED_BLUE_WPS 15
 #define DIR825C1_GPIO_LED_ORANGE_PLANET19
 #define DIR825C1_GPIO_LED_BLUE_PLANET  18
 
@@ -50,23 +51,32 @@
.name   = "d-link:blue:usb",
.gpio   = DIR825C1_GPIO_LED_BLUE_USB,
.active_low = 1,
-   }, {
+   },
+   {
.name   = "d-link:orange:power",
.gpio   = DIR825C1_GPIO_LED_ORANGE_POWER,
.active_low = 1,
-   }, {
+   },
+   {
.name   = "d-link:blue:power",
.gpio   = DIR825C1_GPIO_LED_BLUE_POWER,
.active_low = 1,
-   }, {
+   },
+   {
+   .name   = "d-link:blue:wps",
+   .gpio   = DIR825C1_GPIO_LED_BLUE_WPS,
+   .active_low = 1,
+   },
+   {
.name   = "d-link:orange:planet",
.gpio   = DIR825C1_GPIO_LED_ORANGE_PLANET,
.active_low = 1,
-   }, {
+   },
+   {
.name   = "d-link:blue:planet",
.gpio   = DIR825C1_GPIO_LED_BLUE_PLANET,
.active_low = 1,
-   }
+   },
 };
 
 static struct gpio_keys_button dir825c1_gpio_keys[] __initdata = {
@@ -77,14 +87,15 @@
.debounce_interval = DIR825C1_KEYS_DEBOUNCE_INTERVAL,
.gpio   = DIR825C1_GPIO_BTN_RESET,
.active_low = 1,
-   }, {
+   },
+   {
.desc   = "wps",
.type   = EV_KEY,
.code   = KEY_WPS_BUTTON,
.debounce_interval = DIR825C1_KEYS_DEBOUNCE_INTERVAL,
.gpio   = DIR825C1_GPIO_BTN_WPS,
.active_low = 1,
-   }
+   },
 };
 
 static struct ar8327_pad_cfg dir825c1_ar8327_pad0_cfg = {
@@ -139,11 +150,11 @@
 {
u8 *mac = (u8 *) KSEG1ADDR(0x1ffe);
u8 *art = (u8 *) KSEG1ADDR(0x1fff);
-   u8 tmpmac[ETH_ALEN];
-   u8 mac1[ETH_ALEN], mac2[ETH_ALEN];
+   u8 mac0[ETH_ALEN], mac1[ETH_ALEN];
+   u8 wmac0[ETH_ALEN], wmac1[ETH_ALEN];
 
-   dir825c1_read_ascii_mac(mac1, mac + DIR825C1_MAC0_OFFSET);
-   dir825c1_read_ascii_mac(mac2, mac + DIR825C1_MAC1_OFFSET);
+   dir825c1_read_ascii_mac(mac0, mac + DIR825C1_MAC0_OFFSET);
+   dir825c1_read_ascii_mac(mac1, mac + DIR825C1_MAC1_OFFSET);
 
ath79_gpio_output_select(DIR825C1_GPIO_LED_BLUE_USB, 
AR934X_GPIO_OUT_GPIO);
 
@@ -158,11 +169,11 @@
ap9x_pci_setup_wmac_led_pin(0, 13);
ap9x_pci_setup_wmac_led_pin(1, 32);
 
-   ath79_init_mac(tmpmac, mac1, 0);
-   ath79_register_wmac(art + DIR825C1_WMAC_CALDATA_OFFSET, tmpmac);
+   ath79_init_mac(wmac0, mac0, 0);
+   ath79_register_wmac(art + DIR825C1_WMAC_CALDATA_OFFSET, wmac0);
 
-   ath79_init_mac(tmpmac, mac2, 0);
-   ap91_pci_init(art + DIR825C1_PCIE_CALDATA_OFFSET, tmpmac);
+   ath79_init_mac(wmac1, mac1, 1);
+   ap91_pci_init(art + DIR825C1_PCIE_CALDATA_OFFSET, wmac1);
 
ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0);
 
@@ -171,7 +182,7 @@
 
ath79_register_mdio(0, 0x0);
 
-   ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0);
+   ath79_init_mac(ath79_eth0_data.mac_addr, mac0, 0);
 
/* GMAC0 is connected to an AR8327N switch */
ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] dir-835-a1 testimage

2013-02-22 Thread Alexander Stadler
Who wanted the "led testimage" for DIR 835 Rev. A?

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


Re: [OpenWrt-Devel] [PATCH] [ar71xx] fixes switch-config for dir-825-c1

2013-02-18 Thread Alexander Stadler
Good answer.
So propably when the last minor issues are corrected (currently only aware of 
leds).
Else its not stability which goes into Attutude Adjustment.. .

Alex

Am 13.02.2013 19:07, schrieb Hanno Schupp:
> For same of stability, that's why. 
> 
> Kind Regards
> 
> Hanno Schupp
> 
> On 14/02/2013, at 6:08 AM, Alexander Stadler  wrote:
> 
>> Hi!
>>
>> Don't know if we backport models for Attitude Adjustment? (Model not 
>> supported on attitude adjustment, so its not that specific patch alone which 
>> needs to be backported, but the whole model.)
>> Or other question: Why don't use trunk?
>>
>> Alex
>>
>> Am 13.02.2013 17:48, schrieb Hanno Schupp:
>>> Can this please be back ported to AA ?
>>>
>>> Kind Regards
>>>
>>> Hanno Schupp
>>>
>>> On 14/02/2013, at 2:33 AM, Alexander Stadler  
>>> wrote:
>>>
>>>> From: Alexander Stadler 
>>>>
>>>> fix switch-config for dir-825-c1
>>>>
>>>> Signed-off-by: Alexander Stadler 
>>>> ---
>>>> diff -urN a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
>>>> b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
>>>> --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
>>>> 2013-02-13 13:59:12.0 +0100
>>>> +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
>>>> 2013-02-13 14:10:46.0 +0100
>>>> @@ -62,13 +62,6 @@
>>>>   ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
>>>>   ;;
>>>>
>>>> -dir-825-c1)
>>>> -ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
>>>> -ucidef_add_switch "switch0" "1" "1"
>>>> -ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
>>>> -ucidef_add_switch_vlan "switch0" "2" "0t 1"
>>>> -;;
>>>> -
>>>> nbg460n_550n_550nh)
>>>>   ucidef_set_interfaces_lan_wan "eth0" "eth1"
>>>>   ucidef_add_switch "switch0" "1" "1"
>>>> @@ -181,6 +174,7 @@
>>>>   ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
>>>>   ;;
>>>>
>>>> +dir-825-c1|\
>>>> wndr4300)
>>>>   ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
>>>>   ucidef_add_switch "switch0" "1" "1"
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] [ar71xx] fixes switch-config for dir-825-c1

2013-02-13 Thread Alexander Stadler
Hi!

Don't know if we backport models for Attitude Adjustment? (Model not supported 
on attitude adjustment, so its not that specific patch alone which needs to be 
backported, but the whole model.)
Or other question: Why don't use trunk?

Alex

Am 13.02.2013 17:48, schrieb Hanno Schupp:
> Can this please be back ported to AA ?
> 
> Kind Regards
> 
> Hanno Schupp
> 
> On 14/02/2013, at 2:33 AM, Alexander Stadler  wrote:
> 
>> From: Alexander Stadler 
>>
>> fix switch-config for dir-825-c1
>>
>> Signed-off-by: Alexander Stadler 
>> ---
>> diff -urN a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
>> b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
>> --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
>> 2013-02-13 13:59:12.0 +0100
>> +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
>> 2013-02-13 14:10:46.0 +0100
>> @@ -62,13 +62,6 @@
>>ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
>>;;
>>
>> -dir-825-c1)
>> -ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
>> -ucidef_add_switch "switch0" "1" "1"
>> -ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
>> -ucidef_add_switch_vlan "switch0" "2" "0t 1"
>> -;;
>> -
>> nbg460n_550n_550nh)
>>ucidef_set_interfaces_lan_wan "eth0" "eth1"
>>ucidef_add_switch "switch0" "1" "1"
>> @@ -181,6 +174,7 @@
>>ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
>>;;
>>
>> +dir-825-c1|\
>> wndr4300)
>>ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
>>ucidef_add_switch "switch0" "1" "1"
>> ___
>> 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 mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] [ar71xx] fixes factory image creation for dir-825-c1

2013-02-13 Thread Alexander Stadler
From: Alexander Stadler 

fix factory image creation for dir-825-c1

Signed-off-by: Alexander Stadler 
---
diff -urN a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
--- a/target/linux/ar71xx/image/Makefile2013-02-13 15:02:30.0 
+0100
+++ b/target/linux/ar71xx/image/Makefile2013-02-13 15:03:06.0 
+0100
@@ -355,7 +355,7 @@
 endef
 
 define Image/Build/Cameo934x
-   $(call 
Image/Build/Cameo,$(1),$(2),$(3),$(cameo934x_mtdlayout),1310720,15007744,$(4))
+   $(call 
Image/Build/Cameo,$(1),$(2),$(3),$(cameo934x_mtdlayout),1310720,15007718,$(4))
 endef
 
 define Image/Build/Cameo934x/initramfs
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] [ar71xx] fixes switch-config for dir-825-c1

2013-02-13 Thread Alexander Stadler
From: Alexander Stadler 

fix switch-config for dir-825-c1

Signed-off-by: Alexander Stadler 
---
diff -urN a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
2013-02-13 13:59:12.0 +0100
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
2013-02-13 14:10:46.0 +0100
@@ -62,13 +62,6 @@
ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
;;
 
-dir-825-c1)
-   ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
-   ucidef_add_switch "switch0" "1" "1"
-   ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
-   ucidef_add_switch_vlan "switch0" "2" "0t 1"
-   ;;
-
 nbg460n_550n_550nh)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" "1" "1"
@@ -181,6 +174,7 @@
ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
;;
 
+dir-825-c1|\
 wndr4300)
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
ucidef_add_switch "switch0" "1" "1"
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] problems with preloaded config

2013-02-11 Thread Alexander Stadler
My effective approach was to edit
package/mac80211/files/lib/wifi/mac80211.sh directly.
Propably you prefer or also need to use
package/base-files/files/lib/functions/uci-defaults.sh
but than don't overlook that its
target/linux/ar71xx/base-files/etc/defconfig/wndr3700 for network config of 
this particular device (only).

But like Felix said,  /etc/uci-defaults should be able to do all you need too, 
don't understand why you think that gets messy?

Alex

Am 10.02.2013 11:20, schrieb David Lang:
> I've got a bunch (~50) of openwrt routers (3700/3800) to configure and I'm 
> running into a problem with the wireless configuration.
> 
> According to the documentation, I should be able to just leave out the MAC 
> entry and on first reboot, openwrt will add it.
> 
> What's happening instead is that two new radio sections get created, with the 
> MAC address in them, default SSID, and disabled.
> 
> How can I work around this without having to gather all the MAC addresses 
> ahead of time and putting them in the config files that I push out to the 
> routers?
> 
> David Lang
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] [ar71xx] fixes whitespaces for dir-825-c1

2013-01-30 Thread Alexander Stadler
From: Alexander Stadler 

fix whitespaces for dir-825-c1

Signed-off-by: Alexander Stadler 
---
diff -urN a/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-825-c1.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-825-c1.c
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-825-c1.c   
2013-01-30 17:59:44.0 +0100
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-825-c1.c   
2013-01-30 18:09:55.0 +0100
@@ -37,14 +37,13 @@
 #define DIR825C1_GPIO_BTN_RESET17
 #define DIR825C1_GPIO_BTN_WPS  16
 
+#define DIR825C1_KEYS_POLL_INTERVAL20  /* msecs */
+#define DIR825C1_KEYS_DEBOUNCE_INTERVAL(3 * 
DIR825C1_KEYS_POLL_INTERVAL)
 
-#define DIR825C1_KEYS_POLL_INTERVAL20  /* msecs */
-#define DIR825C1_KEYS_DEBOUNCE_INTERVAL(3 * 
DIR825C1_KEYS_POLL_INTERVAL)
-
-#define DIR825C1_MAC0_OFFSET 0x4
-#define DIR825C1_MAC1_OFFSET 0x18
-#define DIR825C1_WMAC_CALDATA_OFFSET 0x1000
-#define DIR825C1_PCIE_CALDATA_OFFSET 0x5000
+#define DIR825C1_MAC0_OFFSET   0x4
+#define DIR825C1_MAC1_OFFSET   0x18
+#define DIR825C1_WMAC_CALDATA_OFFSET   0x1000
+#define DIR825C1_PCIE_CALDATA_OFFSET   0x5000
 
 static struct gpio_led dir825c1_leds_gpio[] __initdata = {
{
diff -urN a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
--- a/target/linux/ar71xx/image/Makefile2013-01-30 17:59:44.0 
+0100
+++ b/target/linux/ar71xx/image/Makefile2013-01-30 18:05:10.0 
+0100
@@ -355,11 +355,11 @@
 endef
 
 define Image/Build/Cameo934x
-$(call 
Image/Build/Cameo,$(1),$(2),$(3),$(cameo934x_mtdlayout),1310720,15007744,$(4))
+   $(call 
Image/Build/Cameo,$(1),$(2),$(3),$(cameo934x_mtdlayout),1310720,15007744,$(4))
 endef
 
 define Image/Build/Cameo934x/initramfs
-$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo934x_mtdlayout))
+   $(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo934x_mtdlayout))
 endef
 
 define Image/Build/Ath
diff -urN 
a/target/linux/ar71xx/patches-3.7/612-MIPS-ath79-add-DIR-825-C1-support.patch 
b/target/linux/ar71xx/patches-3.7/612-MIPS-ath79-add-DIR-825-C1-support.patch
--- 
a/target/linux/ar71xx/patches-3.7/612-MIPS-ath79-add-DIR-825-C1-support.patch   
2013-01-30 17:59:44.0 +0100
+++ 
b/target/linux/ar71xx/patches-3.7/612-MIPS-ath79-add-DIR-825-C1-support.patch   
2013-01-30 18:07:52.0 +0100
@@ -15,15 +15,15 @@
select ATH79_DEV_USB
  
 +config ATH79_MACH_DIR_825_C1
-+bool "D-Link DIR-825 rev. C1 board support"
-+select SOC_AR934X
-+select ATH79_DEV_AP9X_PCI if PCI
-+select ATH79_DEV_ETH
-+select ATH79_DEV_GPIO_BUTTONS
-+select ATH79_DEV_LEDS_GPIO
-+select ATH79_DEV_M25P80
-+select ATH79_DEV_USB
-+select ATH79_DEV_WMAC
++  bool "D-Link DIR-825 rev. C1 board support"
++  select SOC_AR934X
++  select ATH79_DEV_AP9X_PCI if PCI
++  select ATH79_DEV_ETH
++  select ATH79_DEV_GPIO_BUTTONS
++  select ATH79_DEV_LEDS_GPIO
++  select ATH79_DEV_M25P80
++  select ATH79_DEV_USB
++  select ATH79_DEV_WMAC
 +
  config ATH79_MACH_EW_DORIN
bool "embedded wireless Dorin Platform support"
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 002/003] [ar71xx] add user space support for dir-825-c1

2013-01-21 Thread Alexander, Stadler
From: Alexander Stadler 

user space support for dir-825-c1

Signed-off-by: Alexander Stadler 
---
diff -urN a/trunk/target/linux/ar71xx/base-files/etc/diag.sh 
b/trunk/target/linux/ar71xx/base-files/etc/diag.sh
--- a/trunk/target/linux/ar71xx/base-files/etc/diag.sh  2012-12-31 
19:36:34.0 +0100
+++ b/trunk/target/linux/ar71xx/base-files/etc/diag.sh  2013-01-07 
20:14:38.0 +0100
@@ -74,6 +74,9 @@
dir-825-b1)
status_led="d-link:orange:power"
;;
+   dir-825-c1)
+   status_led="d-link:orange:power"
+   ;;
eap7660d)
status_led="eap7660d:green:ds4"
;;
diff -urN a/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 
b/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
--- a/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 
2012-12-31 19:36:34.0 +0100
+++ b/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 
2013-01-07 20:16:32.0 +0100
@@ -64,6 +64,10 @@
ucidef_set_led_usbdev "usb" "USB" "d-link:blue:usb" "1-1"
;;
 
+dir-825-c1)
+   ucidef_set_led_usbdev "usb" "USB" "d-link:blue:usb" "1-1"
+   ;;
+
 hornet-ub)
ucidef_set_led_netdev "lan" "LAN" "alfa:blue:lan" "eth0"
ucidef_set_led_netdev "wan" "WAN" "alfa:blue:wan" "eth1"
diff -urN a/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
b/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
--- a/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network  
2012-12-31 19:36:34.0 +0100
+++ b/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network  
2013-01-07 20:18:26.0 +0100
@@ -55,6 +55,13 @@
ucidef_add_switch_vlan "rtl8366s" "1" "0 1 2 3 5t"
;;
 
+dir-825-c1)
+ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ucidef_add_switch "eth0" "1" "1"
+ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
+ucidef_add_switch_vlan "eth0" "2" "0t 1"
+;;
+
 nbg460n_550n_550nh)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "rtl8366s" "1" "1"
diff -urN a/trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh
--- a/trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh2012-12-31 
19:36:34.0 +0100
+++ b/trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh2013-01-07 
20:20:02.0 +0100
@@ -210,6 +210,9 @@
*"DIR-825 rev. B1")
name="dir-825-b1"
;;
+   *"DIR-825 rev. C1")
+   name="dir-825-c1"
+   ;;
*EAP7660D)
name="eap7660d"
;;
diff -urN a/trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
--- a/trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh  
2012-12-31 19:36:34.0 +0100
+++ b/trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh  
2013-01-07 20:21:33.0 +0100
@@ -107,6 +107,7 @@
dir-600-a1 | \
dir-615-c1 | \
dir-615-e4 | \
+dir-825-c1 | \
ew-dorin | \
ew-dorin-router | \
mzk-w04nu | \
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 001/003] [ar71xx] add kernel support for dir-825-c1

2013-01-21 Thread Alexander, Stadler
From: Alexander Stadler 

kernel support for dir-825-c1

Signed-off-by: Alexander Stadler 
---
diff -urN a/trunk/target/linux/ar71xx/config-3.7 
b/trunk/target/linux/ar71xx/config-3.7
--- a/trunk/target/linux/ar71xx/config-3.7  2012-12-31 19:36:34.0 
+0100
+++ b/trunk/target/linux/ar71xx/config-3.7  2013-01-07 19:53:10.0 
+0100
@@ -38,6 +38,7 @@
 CONFIG_ATH79_MACH_DIR_600_A1=y
 CONFIG_ATH79_MACH_DIR_615_C1=y
 CONFIG_ATH79_MACH_DIR_825_B1=y
+CONFIG_ATH79_MACH_DIR_825_C1=y
 CONFIG_ATH79_MACH_EAP7660D=y
 CONFIG_ATH79_MACH_EW_DORIN=y
 CONFIG_ATH79_MACH_HORNET_UB=y
diff -urN 
a/trunk/target/linux/ar71xx/patches-3.7/610-MIPS-ath79-openwrt-machines.patch 
b/trunk/target/linux/ar71xx/patches-3.7/610-MIPS-ath79-openwrt-machines.patch
--- 
a/trunk/target/linux/ar71xx/patches-3.7/610-MIPS-ath79-openwrt-machines.patch   
2012-12-31 19:36:34.0 +0100
+++ 
b/trunk/target/linux/ar71xx/patches-3.7/610-MIPS-ath79-openwrt-machines.patch   
2013-01-07 20:04:27.0 +0100
@@ -1,6 +1,6 @@
 --- a/arch/mips/ath79/machtypes.h
 +++ b/arch/mips/ath79/machtypes.h
-@@ -16,22 +16,112 @@
+@@ -16,22 +16,113 @@
  
  enum ath79_mach_type {
ATH79_MACH_GENERIC = 0,
@@ -26,6 +26,7 @@
 +  ATH79_MACH_DIR_615_C1,  /* D-Link DIR-615 rev. C1 */
 +  ATH79_MACH_DIR_615_E4,  /* D-Link DIR-615 rev. E4 */
 +  ATH79_MACH_DIR_825_B1,  /* D-Link DIR-825 rev. B1 */
++  ATH79_MACH_DIR_825_C1,  /* D-Link DIR-825 rev. C1 */
 +  ATH79_MACH_EW_DORIN,/* embedded wireless Dorin Platform */
 +  ATH79_MACH_EW_DORIN_ROUTER, /* embedded wireless Dorin Router 
Platform */
 +  ATH79_MACH_EAP7660D,/* Senao EAP7660D */
@@ -216,7 +217,7 @@
  config ATH79_MACH_PB44
bool "Atheros PB44 reference board"
select SOC_AR71XX
-@@ -68,6 +148,488 @@ config ATH79_MACH_PB44
+@@ -68,6 +148,499 @@ config ATH79_MACH_PB44
  Say 'Y' here if you want your kernel to support the
  Atheros PB44 reference board.
  
@@ -343,6 +344,17 @@
 +  select ATH79_DEV_M25P80
 +  select ATH79_DEV_USB
 +
++config ATH79_MACH_DIR_825_C1
++bool "D-Link DIR-825 rev. C1 board support"
++select SOC_AR934X
++select ATH79_DEV_AP9X_PCI if PCI
++select ATH79_DEV_ETH
++select ATH79_DEV_GPIO_BUTTONS
++select ATH79_DEV_LEDS_GPIO
++select ATH79_DEV_M25P80
++select ATH79_DEV_USB
++select ATH79_DEV_WMAC
++
 +config ATH79_MACH_EW_DORIN
 +  bool "embedded wireless Dorin Platform support"
 +  select SOC_AR933X
@@ -767,7 +779,7 @@
  endif
 --- a/arch/mips/ath79/Makefile
 +++ b/arch/mips/ath79/Makefile
-@@ -38,9 +38,71 @@ obj-$(CONFIG_ATH79_ROUTERBOOT)  += route
+@@ -38,9 +38,72 @@ obj-$(CONFIG_ATH79_ROUTERBOOT)  += route
  #
  # Machines
  #
@@ -787,6 +799,7 @@
 +obj-$(CONFIG_ATH79_MACH_DIR_600_A1)   += mach-dir-600-a1.o
 +obj-$(CONFIG_ATH79_MACH_DIR_615_C1)   += mach-dir-615-c1.o
 +obj-$(CONFIG_ATH79_MACH_DIR_825_B1)   += mach-dir-825-b1.o
++obj-$(CONFIG_ATH79_MACH_DIR_825_C1)   += mach-dir-825-c1.o
 +obj-$(CONFIG_ATH79_MACH_EW_DORIN) += mach-ew-dorin.o
 +obj-$(CONFIG_ATH79_MACH_EAP7660D) += mach-eap7660d.o
 +obj-$(CONFIG_ATH79_MACH_JA76PF)   += mach-ja76pf.o
diff -urN a/trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-825-c1.c 
b/trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-825-c1.c
--- a/trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-825-c1.c 
1970-01-01 01:00:00.0 +0100
+++ b/trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-825-c1.c 
2013-01-20 22:40:32.0 +0100
@@ -0,0 +1,199 @@
+/*
+ *  D-Link DIR-825 rev. C1 board support
+ *
+ *  Copyright (C) 2013 Alexander Stadler
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include "common.h"
+#include "dev-ap9x-pci.h"
+#include "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-spi.h"
+#include "dev-usb.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+
+#define DIR825C1_GPIO_LED_BLUE_USB 11
+#define DIR825C1_GPIO_LED_ORANGE_POWER 15
+#define DIR825C1_GPIO_LED_BLUE_POWER   14
+//#define DIR825C1_GPIO_LED_BLUE_WPS   27
+#define DIR825C1_GPIO_LED_ORANGE_PLANET19
+#define DIR825C1_GPIO_LED_BLUE_PLANET  18
+
+#define DIR825C1_GPIO_BTN_RESET17
+#define DIR825C1_GPIO_BTN_WPS  16
+
+//#define DIR825C1_GPIO_USB_POWER  26
+
+#define DIR825C1_KEYS_POLL_INTERVAL20  /* msecs */

[OpenWrt-Devel] [PATCH 003/003] [ar71xx] add profile support for dir-825-c1

2013-01-21 Thread Alexander, Stadler
From: Alexander Stadler 

profile support for dir-825-c1

Signed-off-by: Alexander Stadler 
---
diff -urN a/trunk/target/linux/ar71xx/generic/profiles/d-link.mk 
b/trunk/target/linux/ar71xx/generic/profiles/d-link.mk
--- a/trunk/target/linux/ar71xx/generic/profiles/d-link.mk  2012-12-31 
19:36:34.0 +0100
+++ b/trunk/target/linux/ar71xx/generic/profiles/d-link.mk  2013-01-07 
20:29:43.0 +0100
@@ -61,3 +61,14 @@
 endef
 
 $(eval $(call Profile,DIR825B1))
+
+define Profile/DIR825C1
+NAME:=D-Link DIR-825 rev. C1
+PACKAGES:=kmod-usb-core mod-usb2 kmod-ledtrig-usbdev
+endef
+
+define Profile/DIR825C1/Description
+Package set optimized for the D-Link DIR-825 rev. C1.
+endef
+
+$(eval $(call Profile,DIR825C1))
diff -urN a/trunk/target/linux/ar71xx/image/Makefile 
b/trunk/target/linux/ar71xx/image/Makefile
--- a/trunk/target/linux/ar71xx/image/Makefile  2012-12-31 19:36:34.0 
+0100
+++ b/trunk/target/linux/ar71xx/image/Makefile  2013-01-07 20:33:23.0 
+0100
@@ -170,6 +170,7 @@
 
cameo7240_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,960k(kernel),2752k(rootfs),64k(mac)ro,64k(art)ro,3712k@0x4(firmware)
 
cameo913x_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(config)ro,960k(kernel),2880k(rootfs),64k(art)ro,3840k@0x3(firmware)
 
cameo933x_mtdlayout=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k(nvram)ro,192k(language)ro,896k(kernel),2752k(rootfs),3648k@0x7(firmware)
+cameo934x_mtdlayout=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,1280k(kernel),14656k(rootfs),192k(lang)ro,64k(mac)ro,64k(art)ro,15936k@0x2(firmware)
 
cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k@0xa(firmware)
 
db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k@0x5(firmware)
 
dir825b1_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,1024k(kernel),5184k(rootfs),64k(caldata)ro,1600k(unknown)ro,6208k@0x5(firmware),64k@0x7f(caldata_copy)
@@ -352,6 +353,14 @@
$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo933x_mtdlayout))
 endef
 
+define Image/Build/Cameo934x
+$(call 
Image/Build/Cameo,$(1),$(2),$(3),$(cameo934x_mtdlayout),1310720,15007744,$(4))
+endef
+
+define Image/Build/Cameo934x/initramfs
+$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo934x_mtdlayout))
+endef
+
 define Image/Build/Ath
$(call Sysupgrade/$(7),$(1),$(2),$(5),$(6))
if [ -e "$(call sysupname,$(1),$(2))" ]; then \
@@ -843,6 +852,8 @@
 
 $(eval $(call 
SingleProfile,Cameo933x,$(fs_squash),TEW712BR,tew-712br,TEW-712BR,ttyATH0,115200,"HORNET-RT-TEW712BR-3"))
 
+$(eval $(call 
SingleProfile,Cameo934x,$(fs_64k),DIR825C1,dir-825-c1,DIR-825-C1,ttyS0,115200,"00DB120AR9344-RT-101214-00"))
+
 $(eval $(call 
SingleProfile,CyberTAN,$(fs_64k),WRT160NL,wrt160nl,WRT160NL,ttyS0,115200,1.00.01))
 
 $(eval $(call 
SingleProfile,DIR825B1,$(fs_64k),DIR825B1,dir-825-b1,DIR-825-B1,ttyS0,115200,01AP94-AR7161-RT-080619-00,00AP94-AR7161-RT-080619-00))
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] add support for dir-825-c1 (2)

2013-01-13 Thread Alexander Stadler
Hi!

Nobody responded to my last patchset, but in the meantime I made some
additions and added whats unclear to me as comments in the mach*.c .

I think some of them are just inconsistencies between the different db120
configs which were made. Propably some of them could be brought in line
(db120, wdr4300, wndr4300 and now dir825c1).
(only additional one I found currently not in the .c file is that
db120_ar8327_led_cfg has .open_drain = true only for db120, can this be
really different there?)

And a question about something I run into while doing this:
Why do I have to do a make distclean (or find the responsable file) so
that the new profile is avalaible in make menuconfig (or for make
defconfig). Should it be that way after a fresh checkout?

It compiles well after the provided .patch files are applied. (I added the
mach-dir-825-c1.c additionally just for direct/easier viewing.)

Please review the patch because I would be glad if the new hardware gets
supported by trunk! (And I will not be suprised when d-link creates more
models on this platform soon (like the dir835..).)

Alex/*
 *  D-Link DIR-825 rev. C1 board support
 *
 *  Copyright (C) 2012 Alexander Stadler
 *  Copyright (C) 2012 Gabor Juhos 
 *
 *  This program is free software; you can redistribute it and/or modify it
 *  under the terms of the GNU General Public License version 2 as published
 *  by the Free Software Foundation.
 */

#include 
#include 
#include 
#include 
#include 
#include 

#include 

#include "common.h"
#include "dev-ap9x-pci.h"
#include "dev-eth.h"
#include "dev-gpio-buttons.h"
#include "dev-leds-gpio.h"
//my: still needed? (see ath79_register_m25p80 below in _setup) (not here in 
wndr4300) (in tl-wdr4300 with additional wdr4300_flash_data..)
#include "dev-m25p80.h"
//my: why here in tl-wdr4300?
#include "dev-spi.h"
//my: why not here in tl-wdr4300 (here in wndr4300 and rb2011)
//#include "dev-nfc.h"
#include "dev-usb.h"
#include "dev-wmac.h"
#include "machtypes.h"

#define DIR825C1_GPIO_LED_BLUE_USB  11 //usb
#define DIR825C1_GPIO_LED_ORANGE_POWER  15 //diag
#define DIR825C1_GPIO_LED_BLUE_POWER14 //power
//my: todo (also see below)
//#define DIR825C1_GPIO_LED_BLUE_WPS27 //ses
#define DIR825C1_GPIO_LED_ORANGE_PLANET 19 //disconnected
#define DIR825C1_GPIO_LED_BLUE_PLANET   18 //connected

/*my: don't know (also see below)
#define DIR825B1_GPIO_BTN_RESET 3
#define DIR825B1_GPIO_BTN_WPS   8
*/

//my: todo (also see _setup) (=OPTION1)
//#define DIR825C1_GPIO_USB_POWER   26
/*my: don't know (also see _setup) (=OPTION2)
#define WDR4300_GPIO_USB1_POWER 22
#define WDR4300_GPIO_USB2_POWER 21
*/

#define DIR825C1_KEYS_POLL_INTERVAL 20  /* msecs */
#define DIR825C1_KEYS_DEBOUNCE_INTERVAL (3 * DIR825C1_KEYS_POLL_INTERVAL)

#define DIR825C1_MAC0_OFFSET 0x4
#define DIR825C1_MAC1_OFFSET 0x18
#define DIR825C1_WMAC_CALDATA_OFFSET 0x1000
#define DIR825C1_PCIE_CALDATA_OFFSET 0x5000

static struct gpio_led dir825c1_leds_gpio[] __initdata = {
{
.name   = "d-link:blue:usb",
.gpio   = DIR825C1_GPIO_LED_BLUE_USB,
.active_low = 1,
}, {
.name   = "d-link:orange:power",
.gpio   = DIR825C1_GPIO_LED_ORANGE_POWER,
.active_low = 1,
}, {
.name   = "d-link:blue:power",
.gpio   = DIR825C1_GPIO_LED_BLUE_POWER,
.active_low = 1,
//my: todo (also see above)
//  }, {
//  .name   = "d-link:blue:wps",
//  .gpio   = DIR825C1_GPIO_LED_BLUE_WPS,
//  .active_low = 1,
}, {
.name   = "d-link:orange:planet",
.gpio   = DIR825C1_GPIO_LED_ORANGE_PLANET,
.active_low = 1,
}, {
.name   = "d-link:blue:planet",
.gpio   = DIR825C1_GPIO_LED_BLUE_PLANET,
.active_low = 1,
}
};

static struct gpio_keys_button dir825c1_gpio_keys[] __initdata = {
/*my: to find (also see above)
{
.desc   = "reset",
.type   = EV_KEY,
.code   = KEY_RESTART,
.debounce_interval = DIR825C1_KEYS_DEBOUNCE_INTERVAL,
.gpio   = DIR825C1_GPIO_BTN_RESET,
.active_low = 1,
}, {
.desc   = "wps",
.type   = EV_KEY,
.code   = KEY_WPS_BUTTON,
.debounce_interval = DIR825C1_KEYS_D

[OpenWrt-Devel] add support for dir-825-c1

2013-01-07 Thread Alexander Stadler
Hi!

Its the first time I try this, so please give the attached patches a review.

To simplify, all points which weren't clear to me are:

dd-wrt has an explicit:
(http://svn.dd-wrt.com/browser/src/router/Makefile.pb42)

ifeq ($(CONFIG_DIR825C1),y)
dd if=$(ARCH)-uclibc/root.uimage of=$(ARCH)-uclibc/aligned.uimage
bs=65536 conv=sync
else
dd if=$(ARCH)-uclibc/root.uimage of=$(ARCH)-uclibc/aligned.uimage 
bs=4096
conv=sync
endif

and:
(src/linux/universal/linux-3.3/drivers/mtd/devices/ar7240_flash.c)
#ifdef CONFIG_DIR825C1
dir_parts[4].offset = dir_parts[5].offset - (mtd->erasesize*2); //nvram
dir_parts[4].size = mtd->erasesize;
#else
dir_parts[4].offset = dir_parts[5].offset - mtd->erasesize; //nvram
dir_parts[4].size = mtd->erasesize;
#endif

Don't see why we should need the 1st one, and no clue for what the 2nd one
is. But in case it's important - I think you can do more with the
information then me.

Besides that 825b1 had the added fat logic it seems like they're built as
the other cameo's. 825c1 doesn't need fat anymore, so i used the standard
routine. But I could change to the 825b1 one so that the backup image
logic (without fat) is included if needed (for whatever that was needed).

Most unsure and complicated for me was the mach-dir-825-c1.c.

#include "dev-nfc.h"
is not used on wdr4300, but on wndr4300, rb2011, and db120 I think. As
it's not a must have, I left it.

#include "dev-m25p80.h"
#include "dev-spi.h"
ath79_register_m25p80(NULL);
Is needed or not?
wdr4300 has it with struct flash_platform_data
wndr4300 doesn't have this at all.
and dir-* changed the ath79_register_m25p80 to NULL like I did now.

wndr4300 only uses at end:
ath79_register_wmac_simple();
ap91_pci_init_simple();
rb2011 seems more special, not sure about db120
so I tried to clone from wdr4300

there:
ap9x_pci_setup_wmac_led_pin(0, 0);
only once? will/can the numbers be the same on this device?
I've commented it for now.

Is GPIO_USB_POWER only needed on some designs?
wdr4300 makes two gpio_request_one, wndr4300 does not.
As I don't know gpio's for now I didn't add it.

I only added 3 gpio's because I'm unsure about the calculation of the
values. I've done this with help of
http://svn.dd-wrt.com/browser/src/router/libutils/utils.c
I hope I guessed/converted these 3 right. No clue what to do with
connected_gpio and disconnected_gpio.
By the way - how to find these values when I have the hardware? (i.e.
activating a gpio from running openwrt so i can see a led flashing, or is
it a risk to come over an other gpio as a led one)
Ah, and no gpio button for now.

And last but not least:
I calculatetd offsets, *mac and *art also from dd-wrt:
http://svn.dd-wrt.com/browser/src/linux/universal/linux-3.3/arch/mips/ar7240/platform.c
dir825b1_read_ascii_mac is the same there, so I hope my values are
correct. But please review it, because coming up without network will be
bad ;-).
The strangest thing there was
#ifdef CONFIG_DIR825C1
u8 *art = (u8 *) KSEG1ADDR(0x1fff1000);
#else
u8 *art = (u8 *) KSEG1ADDR(0x1fff);
But I don't think it plays into anything.

(Also the partitions there seem to be ugly if
http://svn.dd-wrt.com/ticket/2722 is right.
I took the info from:
http://www.wikidevi.com/wiki/D-Link_DIR-835_rev_A1)

But I'm unsure how to handle the two mac adresses then, and where the wan
one is. dd-wrt's code is hard to read. 825b1 differs much, but at least
this info could be helpful (besides dd-wrt's platform.c):
dir 825b1 seems to have (from https://dev.openwrt.org/ticket/10357)
LAN and WLAN0 address = DIR825B1_MAC_LOCATION_0
WAN address = DIR825B1_MAC_LOCATION_1
WLAN1 address = = DIR825B1_MAC_LOCATION_1 + 1

So thank you for the time and please help, as I think there are only a few
changes of someone experienced needed for everything to be fine.

DIR835 can be added then too (not avalaible here, but same thing as with
WDR4300 and WDR3600 - additional wifi chip is 2 or 3 chains).
Ah, the second wifi chip on DIR825c1 is an AR9382 (AR9380) not AR9582
(AR9580) like on the currently supported models (WNDR4300,WDR4300/3600).
And the next step could be the WNDR3700v4 then
(https://forum.openwrt.org/viewtopic.php?id=41093). But they always seemed
to be a bit more non standard for switch configuration :-/.

Alexdiff -urN a/trunk/target/linux/ar71xx/config-3.6 b/trunk/target/linux/ar71xx/config-3.6
--- a/trunk/target/linux/ar71xx/config-3.6	2012-12-31 19:36:34.0 +0100
+++ b/trunk/target/linux/ar71xx/config-3.6	2013-01-07 19:53:08.0 +0100
@@ -38,6 +38,7 @@
 CONFIG_ATH79_MACH_DIR_600_A1=y
 CONFIG_ATH79_MACH_DIR_615_C1=y
 CONFIG_ATH79_MACH_DIR_825_B1=y
+CONFIG_ATH79_MACH_DIR_825_C1=y
 CONFIG_ATH79_MACH_EAP7660D=y
 CONFIG_ATH79_MACH_EW_DORIN=y
 CONFIG_ATH79_MACH_HORNET_UB=y
diff -urN a/trunk/target/linux/ar71xx/config-3.7 b/trunk/target/linux/ar71xx/config-3.7
--- a/trunk/target/linux/ar71xx/config-3.7	2012-12-31 19:36:34.0 +0100
+++

[OpenWrt-Devel] net-next and attitude_adjustment

2012-11-30 Thread Alexander Stadler
Hi!

Any Reason why
060-tcp-ecn-dont-delay-ACKS-after-CE.patch
061-fq_codel-dont-reinit-flow-state.patch
dont find their way into attitude_adjustment?

Especially after other patches which will go into net-next.git were
applied yesterday.

Thanks

Alex

 Ursprüngliche Nachricht 
Betreff: Re: [OpenWrt-Devel] [PATCH 4/5] kernel: Add ATM fixes pending
upstream merge (queue reduction, race fixes)
Von: "Alexander Stadler" 
Datum:   Do, 29.11.2012, 19:07
An:  "OpenWrt Development List" 
--

Do you want to backport
060-tcp-ecn-dont-delay-ACKS-after-CE.patch
061-fq_codel-dont-reinit-flow-state.patch
now? (were r33686, r33687 / r33887)

Seems like a good moment for that?

Thanks!

On Do, 29.11.2012, 18:47, Gabor Juhos wrote:
> 2012.11.29. 1:23 keltezéssel, David Woodhouse írta:
>> Patches about to go into net-next.git
>>
>> Signed-off-by: David Woodhouse 
>
> Applied this one, however it seems that 3/5 is lost somewhere.
>
> Thanks,
> Gabor
>
> ___
> 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 mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 4/5] kernel: Add ATM fixes pending upstream merge (queue reduction, race fixes)

2012-11-29 Thread Alexander Stadler
Do you want to backport
060-tcp-ecn-dont-delay-ACKS-after-CE.patch
061-fq_codel-dont-reinit-flow-state.patch
now? (were r33686, r33687 / r33887)

Seems like a good moment for that?

Thanks!

On Do, 29.11.2012, 18:47, Gabor Juhos wrote:
> 2012.11.29. 1:23 keltezéssel, David Woodhouse írta:
>> Patches about to go into net-next.git
>>
>> Signed-off-by: David Woodhouse 
>
> Applied this one, however it seems that 3/5 is lost somewhere.
>
> Thanks,
> Gabor
>
> ___
> 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


Re: [OpenWrt-Devel] What are the criterias for backports into attitude_adjustment? (2)

2012-11-19 Thread Alexander Stadler
Thanks for the answer.
So I guess it would be wise to bundle it when doing a backport there like
r34084 was.

But there is no general rule or guideline when to backport (or which ones
are mandatory). More an individual decision just made case by case?


On Mo, 19.11.2012, 11:03, Florian Fainelli wrote:
> On Sunday 18 November 2012 16:50:32 Alexander Stadler wrote:
>> Nobody here to answer the rather simple question? (see below)
>
> I don't think these patches are important enough to trigger a kernel
> rebuild
> for all AA targets, but that is just my opinion.
>
>>
>> On Sa, 10.11.2012, 19:15, Alexander Stadler wrote:
>> > Can someone please answer what the criterias for backports into
>> > attitude_adjustment are?
>> > Jow just closes it as a ticket (https://dev.openwrt.org/ticket/12355).
>> > And no response here.
>> > Thats not so great for collaboration.
>> > In this case I ask because of r33686 and r33687 (r33887), see below.
>> >
>> > Thanks
>> >
>> > Alex
>> >
>> > On Mi, 7.11.2012, 22:38, Alexander Stadler wrote:
>> >> This and the following patch went into trunk r33686 and r33687
>> (r33887).
>> >> What are the criterias for backports into attitude_adjustment?
>> >> I'm asking because some make it into there directly and if this went
>> >> upstream i thought its going to be a canditate soon.
%

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


[OpenWrt-Devel] What are the criterias for backports into attitude_adjustment? (2)

2012-11-18 Thread Alexander Stadler
Nobody here to answer the rather simple question? (see below)

On Sa, 10.11.2012, 19:15, Alexander Stadler wrote:
> Can someone please answer what the criterias for backports into
> attitude_adjustment are?
> Jow just closes it as a ticket (https://dev.openwrt.org/ticket/12355).
> And no response here.
> Thats not so great for collaboration.
> In this case I ask because of r33686 and r33687 (r33887), see below.
>
> Thanks
>
> Alex
>
> On Mi, 7.11.2012, 22:38, Alexander Stadler wrote:
>> This and the following patch went into trunk r33686 and r33687 (r33887).
>> What are the criterias for backports into attitude_adjustment?
>> I'm asking because some make it into there directly and if this went
>> upstream i thought its going to be a canditate soon.
>>
>> Thanks!
>>
>> Alex
>>
>> On Mo, 1.10.2012, 17:49, Dave Täht wrote:
>>> From: Dave Taht 
>>>
>>> Bugfix from linux head - don't delay acks from ECN congestion
>>> experienced in some situations.
>>> ---
>>>  ...net-next-tcp-ecn-dont-delay-ACKS-after-CE.patch |   63
>>> 
>>>  1 file changed, 63 insertions(+)
>>>  create mode 100644
>>> target/linux/generic/patches-3.3/050-net-next-tcp-ecn-dont-delay-ACKS-after-CE.patch
>>>
>>> diff --git
>>> a/target/linux/generic/patches-3.3/050-net-next-tcp-ecn-dont-delay-ACKS-after-CE.patch
>>> b/target/linux/generic/patches-3.3/050-net-next-tcp-ecn-dont-delay-ACKS-after-CE.patch
>>> new file mode 100644
>>> index 000..547e4fa
>>> --- /dev/null
>>> +++
>>> b/target/linux/generic/patches-3.3/050-net-next-tcp-ecn-dont-delay-ACKS-after-CE.patch
>>> @@ -0,0 +1,63 @@
>>> +From patchwork Mon Aug  6 21:04:43 2012
>>> +Content-Type: text/plain; charset="utf-8"
>>> +MIME-Version: 1.0
>>> +Content-Transfer-Encoding: 7bit
>>> +Subject: [net-next] tcp: ecn: dont delay ACKS after CE
>>> +Date: Mon, 06 Aug 2012 11:04:43 -
>>> +From: Eric Dumazet 
>>> +X-Patchwork-Id: 175453
>>> +Message-Id: <1344287083.26674.83.camel@edumazet-glaptop>
>>> +To: David Miller 
>>> +Cc: netdev ,
>>> +   Neal Cardwell 
>>> +
>>> +From: Eric Dumazet 
>>> +
>>> +While playing with CoDel and ECN marking, I discovered a
>>> +non optimal behavior of receiver of CE (Congestion Encountered)
>>> +segments.
>>> +
>>> +In pathological cases, sender has reduced its cwnd to low values,
>>> +and receiver delays its ACK (by 40 ms).
>>> +
>>> +While RFC 3168 6.1.3 (The TCP Receiver) doesn't explicitly recommend
>>> +to send immediate ACKS, we believe its better to not delay ACKS,
>>> because
>>> +a CE segment should give same signal than a dropped segment, and its
>>> +quite important to reduce RTT to give ECE/CWR signals as fast as
>>> +possible.
>>> +
>>> +Note we already call tcp_enter_quickack_mode() from TCP_ECN_check_ce()
>>> +if we receive a retransmit, for the same reason.
>>> +
>>> +Signed-off-by: Eric Dumazet 
>>> +Cc: Neal Cardwell 
>>> +Acked-by: Neal Cardwell 
>>> +
>>> +---
>>> +net/ipv4/tcp_input.c |6 +-
>>> + 1 file changed, 5 insertions(+), 1 deletion(-)
>>> +
>>> +
>>> +
>>> +--
>>> +To unsubscribe from this list: send the line "unsubscribe netdev" in
>>> +the body of a message to majord...@vger.kernel.org
>>> +More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>> +
>>> +diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
>>> +index 2fd2bc9..fa2c2c2 100644
>>> +--- a/net/ipv4/tcp_input.c
>>>  b/net/ipv4/tcp_input.c
>>> +@@ -237,7 +237,11 @@ static inline void TCP_ECN_check_ce(struct
>>> tcp_sock
>>> *tp, const struct sk_buff *s
>>> +   tcp_enter_quickack_mode((struct sock *)tp);
>>> +   break;
>>> +   case INET_ECN_CE:
>>> +-  tp->ecn_flags |= TCP_ECN_DEMAND_CWR;
>>> ++  if (!(tp->ecn_flags & TCP_ECN_DEMAND_CWR)) {
>>> ++  /* Better not delay acks, sender can have a very low 
>>> cwnd */
>>> ++  tcp_enter_quickack_mode((struct sock *)tp);
>>> ++  tp->ecn_flags |= TCP_ECN_DEMAND_CWR;
>>> ++  }
>>> +   /* fallinto */
>>> +   default:
>>> +   tp->ecn_flags |= TCP_ECN_SEEN;
>>> --
>>> 1.7.9.5
>>>
>>> ___
>>> 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 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] What are the criterias for backports into attitude_adjustment?

2012-11-10 Thread Alexander Stadler
Can someone please answer what the criterias for backports into
attitude_adjustment are?
Jow just closes it as a ticket (https://dev.openwrt.org/ticket/12355).
And no response here.
Thats not so great for collaboration.
In this case I ask because of r33686 and r33687 (r33887), see below.

Thanks

Alex

On Mi, 7.11.2012, 22:38, Alexander Stadler wrote:
> This and the following patch went into trunk r33686 and r33687 (r33887).
> What are the criterias for backports into attitude_adjustment?
> I'm asking because some make it into there directly and if this went
> upstream i thought its going to be a canditate soon.
>
> Thanks!
>
> Alex
>
> On Mo, 1.10.2012, 17:49, Dave Täht wrote:
>> From: Dave Taht 
>>
>> Bugfix from linux head - don't delay acks from ECN congestion
>> experienced in some situations.
>> ---
>>  ...net-next-tcp-ecn-dont-delay-ACKS-after-CE.patch |   63
>> 
>>  1 file changed, 63 insertions(+)
>>  create mode 100644
>> target/linux/generic/patches-3.3/050-net-next-tcp-ecn-dont-delay-ACKS-after-CE.patch
>>
>> diff --git
>> a/target/linux/generic/patches-3.3/050-net-next-tcp-ecn-dont-delay-ACKS-after-CE.patch
>> b/target/linux/generic/patches-3.3/050-net-next-tcp-ecn-dont-delay-ACKS-after-CE.patch
>> new file mode 100644
>> index 000..547e4fa
>> --- /dev/null
>> +++
>> b/target/linux/generic/patches-3.3/050-net-next-tcp-ecn-dont-delay-ACKS-after-CE.patch
>> @@ -0,0 +1,63 @@
>> +From patchwork Mon Aug  6 21:04:43 2012
>> +Content-Type: text/plain; charset="utf-8"
>> +MIME-Version: 1.0
>> +Content-Transfer-Encoding: 7bit
>> +Subject: [net-next] tcp: ecn: dont delay ACKS after CE
>> +Date: Mon, 06 Aug 2012 11:04:43 -
>> +From: Eric Dumazet 
>> +X-Patchwork-Id: 175453
>> +Message-Id: <1344287083.26674.83.camel@edumazet-glaptop>
>> +To: David Miller 
>> +Cc: netdev ,
>> +Neal Cardwell 
>> +
>> +From: Eric Dumazet 
>> +
>> +While playing with CoDel and ECN marking, I discovered a
>> +non optimal behavior of receiver of CE (Congestion Encountered)
>> +segments.
>> +
>> +In pathological cases, sender has reduced its cwnd to low values,
>> +and receiver delays its ACK (by 40 ms).
>> +
>> +While RFC 3168 6.1.3 (The TCP Receiver) doesn't explicitly recommend
>> +to send immediate ACKS, we believe its better to not delay ACKS,
>> because
>> +a CE segment should give same signal than a dropped segment, and its
>> +quite important to reduce RTT to give ECE/CWR signals as fast as
>> +possible.
>> +
>> +Note we already call tcp_enter_quickack_mode() from TCP_ECN_check_ce()
>> +if we receive a retransmit, for the same reason.
>> +
>> +Signed-off-by: Eric Dumazet 
>> +Cc: Neal Cardwell 
>> +Acked-by: Neal Cardwell 
>> +
>> +---
>> +net/ipv4/tcp_input.c |6 +-
>> + 1 file changed, 5 insertions(+), 1 deletion(-)
>> +
>> +
>> +
>> +--
>> +To unsubscribe from this list: send the line "unsubscribe netdev" in
>> +the body of a message to majord...@vger.kernel.org
>> +More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> +
>> +diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
>> +index 2fd2bc9..fa2c2c2 100644
>> +--- a/net/ipv4/tcp_input.c
>>  b/net/ipv4/tcp_input.c
>> +@@ -237,7 +237,11 @@ static inline void TCP_ECN_check_ce(struct
>> tcp_sock
>> *tp, const struct sk_buff *s
>> +tcp_enter_quickack_mode((struct sock *)tp);
>> +break;
>> +case INET_ECN_CE:
>> +-   tp->ecn_flags |= TCP_ECN_DEMAND_CWR;
>> ++   if (!(tp->ecn_flags & TCP_ECN_DEMAND_CWR)) {
>> ++   /* Better not delay acks, sender can have a very low 
>> cwnd */
>> ++   tcp_enter_quickack_mode((struct sock *)tp);
>> ++   tp->ecn_flags |= TCP_ECN_DEMAND_CWR;
>> ++   }
>> +/* fallinto */
>> +default:
>> +tp->ecn_flags |= TCP_ECN_SEEN;
>> --
>> 1.7.9.5
>>
>> ___
>> 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 mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 1/8] net-next: dont delay acks after ECN CE

2012-11-07 Thread Alexander Stadler
This and the following patch went into trunk r33686 and r33687 (r33887).
What are the criterias for backports into attitude_adjustment?
I'm asking because some make it into there directly and if this went
upstream i thought its going to be a canditate soon.

Thanks!

Alex

On Mo, 1.10.2012, 17:49, Dave Täht wrote:
> From: Dave Taht 
>
> Bugfix from linux head - don't delay acks from ECN congestion
> experienced in some situations.
> ---
>  ...net-next-tcp-ecn-dont-delay-ACKS-after-CE.patch |   63
> 
>  1 file changed, 63 insertions(+)
>  create mode 100644
> target/linux/generic/patches-3.3/050-net-next-tcp-ecn-dont-delay-ACKS-after-CE.patch
>
> diff --git
> a/target/linux/generic/patches-3.3/050-net-next-tcp-ecn-dont-delay-ACKS-after-CE.patch
> b/target/linux/generic/patches-3.3/050-net-next-tcp-ecn-dont-delay-ACKS-after-CE.patch
> new file mode 100644
> index 000..547e4fa
> --- /dev/null
> +++
> b/target/linux/generic/patches-3.3/050-net-next-tcp-ecn-dont-delay-ACKS-after-CE.patch
> @@ -0,0 +1,63 @@
> +From patchwork Mon Aug  6 21:04:43 2012
> +Content-Type: text/plain; charset="utf-8"
> +MIME-Version: 1.0
> +Content-Transfer-Encoding: 7bit
> +Subject: [net-next] tcp: ecn: dont delay ACKS after CE
> +Date: Mon, 06 Aug 2012 11:04:43 -
> +From: Eric Dumazet 
> +X-Patchwork-Id: 175453
> +Message-Id: <1344287083.26674.83.camel@edumazet-glaptop>
> +To: David Miller 
> +Cc: netdev ,
> + Neal Cardwell 
> +
> +From: Eric Dumazet 
> +
> +While playing with CoDel and ECN marking, I discovered a
> +non optimal behavior of receiver of CE (Congestion Encountered)
> +segments.
> +
> +In pathological cases, sender has reduced its cwnd to low values,
> +and receiver delays its ACK (by 40 ms).
> +
> +While RFC 3168 6.1.3 (The TCP Receiver) doesn't explicitly recommend
> +to send immediate ACKS, we believe its better to not delay ACKS, because
> +a CE segment should give same signal than a dropped segment, and its
> +quite important to reduce RTT to give ECE/CWR signals as fast as
> +possible.
> +
> +Note we already call tcp_enter_quickack_mode() from TCP_ECN_check_ce()
> +if we receive a retransmit, for the same reason.
> +
> +Signed-off-by: Eric Dumazet 
> +Cc: Neal Cardwell 
> +Acked-by: Neal Cardwell 
> +
> +---
> +net/ipv4/tcp_input.c |6 +-
> + 1 file changed, 5 insertions(+), 1 deletion(-)
> +
> +
> +
> +--
> +To unsubscribe from this list: send the line "unsubscribe netdev" in
> +the body of a message to majord...@vger.kernel.org
> +More majordomo info at  http://vger.kernel.org/majordomo-info.html
> +
> +diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> +index 2fd2bc9..fa2c2c2 100644
> +--- a/net/ipv4/tcp_input.c
>  b/net/ipv4/tcp_input.c
> +@@ -237,7 +237,11 @@ static inline void TCP_ECN_check_ce(struct tcp_sock
> *tp, const struct sk_buff *s
> + tcp_enter_quickack_mode((struct sock *)tp);
> + break;
> + case INET_ECN_CE:
> +-tp->ecn_flags |= TCP_ECN_DEMAND_CWR;
> ++if (!(tp->ecn_flags & TCP_ECN_DEMAND_CWR)) {
> ++/* Better not delay acks, sender can have a very low 
> cwnd */
> ++tcp_enter_quickack_mode((struct sock *)tp);
> ++tp->ecn_flags |= TCP_ECN_DEMAND_CWR;
> ++}
> + /* fallinto */
> + default:
> + tp->ecn_flags |= TCP_ECN_SEEN;
> --
> 1.7.9.5
>
> ___
> 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


Re: [OpenWrt-Devel] [PATCH] ppp switch to version 2.4.4

2009-07-29 Thread Alexander Stadler
Hi!

I just wanted to state that I've submittet "the" ppp patch a month ago (24.6.) 
with some others.
Unfortunately I think none of them got applied yet.. . I'm using this updates 
for months now.
(pptpd 1.3.0->1.3.4, mppc support for Kernel 2.6, memory bug fix of 
paravirtualization for kernel 2.6.25 (fixed in 2.6.29 I think), ppp 
2.4.3->2.4.4 with many patches, mppc support for ppp 2.4.4, mppe-optional 
option for pppd, (clocksource tsc below acpi and reboot=bios to reboot=acpi on 
x86 - should propably go in an "ACPI Hardware" or "VMWare" or something like 
that profile).

Alex


Vladimir Voronkov schrieb:
> Hi, Florian,
> 
> I am new to submitting patches for openWRT, I am sorry for some mistakes in 
> the emails. Should I re-send 
> them again or you have applied the patches? How can I see the revision number 
> with my changes?
> 
> About configuration file for OpenL2TP - I was unable to build it with 
> L2TP_FEATURE_LOCAL_CONF_FILE because 
> of some dependencies that I couldn't resolve. For now OpenL2TP can only be 
> configured via rpc tool 
> l2tpconfig, see how it is used in my script. I understand that it is not 
> acceptable for generic purposes, 
> I just included in for you guys to see how it can be used in openwrt 
> configuration. Unfortunately I am not 
> aware of how UCI works. If you give me advice on how I can create startup 
> scrips or maybe some link where 
> I can read more info about it I will definitely improve that. I have in plans 
> to integrate it also in 
> luci-admin tool but I still investigating the code how you do this.
> 
> About kmod-pppol2tp for kernel version 2.6.28 and newer - what I can say is - 
> it works on my system:
> device is Linksys WRT54GL v. 1.1
> 
>  KAMIKAZE (8.09.1, r16973) 
> r...@openwrt:~# cat /proc/version
> Linux version 2.6.25.20 (v...@vvv-vm-ubuntu) (gcc version 4.1.2) #6 Sat Jul 
> 25 22:44:13 MSD 2009
> 
> and loaded
> 
> r...@openwrt:~# lsmod
> Module  Size  Used byNot tainted
> ...
> pppol2tp   29648  4
> 
> 
> OpenL2TP doesn't work without it.
> 
> I also have quiestion about WiFi for my device. I built the firmware from 
> revision r16973, choosing 
> Broadcom BCM947xx/953xx [2.6] as a target and Broadcom BCM43xx WiFi as a 
> profile but I don't see that 
> kmod-b43 module is built and installed in my system. Revision is 8.09.1, 
> r16973. That is why WiFi isn't 
> working. Could you please explain what I did wrong or maybe what packages I 
> should include into my build.
> 
> Thanks for your support!
> 
> -Original Message-
> From: Florian Fainelli 
> To: openwrt-devel@lists.openwrt.org
> Date: Sun, 26 Jul 2009 12:27:22 +0200
> Subject: Re: [OpenWrt-Devel] [PATCH] ppp switch to version 2.4.4
> 
>> Hi Validimir,
>>
>> Le Sunday 26 July 2009 10:45:38 Vladimir Voronkov, vous avez Иcrit :
>>> This patch changes version of ppp to 2.4.4, which is required for
>>> openl2tp-1.6 to work. Patch with integration of openl2tp will be sent in my
>>> next email.
>>>
>>> All current patches to ppp-2.4.3 are changed according to a new version of
>>> ppp, some of them are removed (namely 102, 202, 205, 207) because they
>>> already exist in ppp-2.4.4.
>> ppp-2.4.4 has been updated a while already, so I have only applied the 
>> kmod-pppol2tp part of this patch. Also PPP over L2TP only appeared in 2.6.28 
>> therefore the module is restricted to the kernel versions it can be built on.
>>
>>> Also kmod-pppol2tp kernel module has been added in configuration.
>>>
>>> Signed-off-by: Vladimir Voronkov 
>>>
>>> ---
>>>
>>> Index: package/kernel/modules/network.mk
>>> ===
>>> --- package/kernel/modules/network.mk   (revision 16973)
>>> +++ package/kernel/modules/network.mk   (working copy)
>>> @@ -367,6 +367,7 @@
>>>FILES:= \
>>> $(LINUX_DIR)/drivers/net/pppoe.$(LINUX_KMOD_SUFFIX) \
>>> $(LINUX_DIR)/drivers/net/pppox.$(LINUX_KMOD_SUFFIX)
>>> +  AUTOLOAD:=$(call AutoLoad,40,pppox pppoe)
>>>  endef
>>>
>>>  define KernelPackage/pppoe/description
>>> @@ -376,6 +377,22 @@
>>>  $(eval $(call KernelPackage,pppoe))
>>>
>>>
>>> +define KernelPackage/pppol2tp
>>> +  SUBMENU:=$(NETWORK_SUPPORT_MENU)
>>> +  TITLE:=PPPoL2TP support
>>> +  DEPENDS:=kmod-ppp +kmod-pppoe
>>> +  KCONFIG:=CONFIG_PPPOL2TP
>>> +  FILES:=$(LINUX_DIR)/drivers/net/pppol2tp.$(LINUX_KMOD_SUFFIX)
>>> +  AUTOLOAD:=$(call AutoLoad,40,pppol2tp)
>>> +endef
>>> +
>>> +define KernelPackage/pppol2tp/description
>>> + Kernel modules for PPPoL2TP (PPP over L2TP) support
>>> +endef
>>> +
>>> +$(eval $(call KernelPackage,pppol2tp))
>>> +
>>> +
>>>  define KernelPackage/pppoa
>>>SUBMENU:=$(NETWORK_SUPPORT_MENU)
>>>TITLE:=PPPoA support
>>> Index: package/ppp/patches/101-debian_ip-up_option.patch
>>> ===
>>> --- package/ppp/patches/101-debian_ip-up_option.patch   (revision 16973)
>

Re: [OpenWrt-Devel] [PATCH] Changes reboot=bios to reboot=acpi on x86 (2)

2009-06-25 Thread Alexander Stadler
> Date: Wed, 24 Jun 2009 08:49:58 -0700 (PDT)
> From: David Richardson 
> To: OpenWrt Development List 
> Subject: Re: [OpenWrt-Devel] [PATCH] Changes reboot=bios to
>   reboot=acpi on  x86
> Message-ID: <553985.69006...@web57904.mail.re3.yahoo.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> On older boards without acpi and without keyboard controllers, this change
> does not yield a reboot method that is equivalent to reboot=bios. ?Vote is
> to not accept this patch. ?

It would propably be the best do add a architecture profile in menuconfig
for VMWare, and make some configurations i.e. reboot=acpi, LSI and
Buslogic SCSI, PIIX, E1000 and PCNet LAN, and some more. If the community
is interested I can post recommended settings. I've done very much on ESX
and Workstation with it.. .

>
> --- On Wed, 6/24/09, Alexander Stadler  wrote:
>
> From: Alexander Stadler 
> Subject: [OpenWrt-Devel] [PATCH] Changes reboot=bios to reboot=acpi on x86
> To: openwrt-devel@lists.openwrt.org
> Date: Wednesday, June 24, 2009, 11:12 AM
>
> Changes reboot=bios to reboot=acpi on x86.
> I'm doing this because reboot=bios lets paravirtualized maschines hang
> when trieing to reboot (and I would recommend to add acpi when using x86,
> but reboot also works with this option when acpi is not enabled).
>
> Signed-off-by: Alexander Stadler 
>
> --
>
> diff -urN a/8.09/target/linux/x86/image/menu.lst
> b/8.09/target/linux/x86/image/menu.lst
> --- a/8.09/target/linux/x86/image/menu.lst??? 2009-04-08
> 17:00:41.0 +0200
> +++ b/8.09/target/linux/x86/image/menu.lst??? 2009-04-16
> 17:55:52.0 +0200
> @@ -6,10 +6,10 @@
>
>  title???OpenWrt
>  root? ? (hd0,0)
> -kernel? /boot/vmlinuz @CMDLINE@ noinitrd console=tty0
> console=ttyS0,@baudr...@n8 reboot=bios
> +kernel? /boot/vmlinuz @CMDLINE@ noinitrd console=tty0
> console=ttyS0,@baudr...@n8 reboot=acpi
>  boot
>
>  title??? OpenWrt (failsafe)
>  root??? (hd0,0)
> -kernel? /boot/vmlinuz failsafe=true @CMDLINE@ noinitrd console=tty0
> console=ttyS0,@baudr...@n8 reboot=bios
> +kernel? /boot/vmlinuz failsafe=true @CMDLINE@ noinitrd console=tty0
> console=ttyS0,@baudr...@n8 reboot=acpi
>  boot

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


[OpenWrt-Devel] [PATCH] Add the option mppe-optional to pppd - 2/2

2009-06-24 Thread Alexander Stadler
Adds the option mppe-optional to pppd.
This fixes a "bug" of OSX to be able to connect with mppe (and not unencrypted 
only) when its set as option in pptpd. Also allow mppc only connections. And 
use mppe by default if set optionally on the client, instead of not using it by 
default then. ("mppe-optional" in combination with "mppe required" instead of 
"mppe" only)

Signed-off-by: Alexander Stadler 

--

diff -urN a/pppd/auth.c b/pppd/auth.c
--- a/pppd/auth.c   2009-05-04 16:41:01.0 +0200
+++ b/pppd/auth.c   2009-05-04 16:42:46.0 +0200
@@ -885,7 +885,7 @@
  */
 ecp_required = ecp_gotoptions[unit].required;
 mppe_required = ccp_gotoptions[unit].mppe;
-if (!ecp_required && !mppe_required)
+if (!ecp_required && (!mppe_required || allow_mppe_fallback))
continue_networks(unit);
 }
 
diff -urN a/pppd/ccp.c b/pppd/ccp.c
--- a/pppd/ccp.c2009-05-04 16:41:13.0 +0200
+++ b/pppd/ccp.c2009-05-04 16:37:32.0 +0200
@@ -136,6 +136,8 @@
   "don't allow MPPE encryption" },
 { "-mppe", o_special_noarg, (void *)setnomppe,
   "don't allow MPPE encryption" },
+{ "mppe-optional", o_bool, &allow_mppe_fallback,
+  "allow falling back to unencrypted connection mode", OPT_PRIO | 1 },
 #endif /* MPPE */
 
 { NULL }
@@ -623,8 +625,13 @@
 
 #ifdef MPPE
 if (ccp_wantoptions[unit].mppe) {
-   error("MPPE required but peer negotiation failed");
-   lcp_close(unit, "MPPE required but peer negotiation failed");
+   if(!allow_mppe_fallback) {
+   error("MPPE required but peer negotiation failed");
+   lcp_close(unit, "MPPE required but peer negotiation failed");
+   } else {
+   error("MPPE required but peer negotiation failed.  "
+ "Falling back and disabling MPPE");
+   }
 }
 #endif /* MPPE */
 }
@@ -669,22 +676,41 @@
auth_mschap_bits >>= 1;
} while (auth_mschap_bits);
if (numbits > 1) {
-   error("MPPE required, but auth done in both directions.");
-   lcp_close(f->unit, "MPPE required but not available");
-   return;
+   if(!allow_mppe_fallback) {
+   error("MPPE required, but auth done in both directions.");
+   lcp_close(f->unit, "MPPE required but not available");
+   return;
+   } else {
+   go->mppe = 0;
+   error("MPPE required, but auth done in both directions.  "
+ "Falling back and disabling MPPE");
+   }
}
if (!numbits) {
-   error("MPPE required, but MS-CHAP[v2] auth not performed.");
-   lcp_close(f->unit, "MPPE required but not available");
-   return;
+   if(!allow_mppe_fallback) {
+   error("MPPE required, but MS-CHAP[v2] auth not performed.");
+   lcp_close(f->unit, "MPPE required but not available");
+   return;
+   } else {
+   go->mppe = 0;
+   error("MPPE required, but MS-CHAP[v2] auth not performed.  "
+ "Falling back and disabling MPPE");
+   }
}
 
/* A plugin (eg radius) may not have obtained key material. */
if (!mppe_keys_set) {
-   error("MPPE required, but keys are not available.  "
- "Possible plugin problem?");
-   lcp_close(f->unit, "MPPE required but not available");
-   return;
+   if(!allow_mppe_fallback) {
+   error("MPPE required, but keys are not available.  "
+ "Possible plugin problem?");
+   lcp_close(f->unit, "MPPE required but not available");
+   return;
+   } else {
+   go->mppe = 0;
+   error("MPPE required, but keys are not available.  "
+ "Possible plugin problem?  "
+ "Falling back and disabling MPPE");
+   }
}
}
 
@@ -1142,8 +1168,14 @@
   so we close connection */
wo->mppc = wo->mppe = wo->mppe_stateless = wo->mppe_40 =
wo->mppe_56 = wo->mppe_128 = 0;
-   lcp_close(f->unit, "MPPE required but cannot negotiate MPPE "
- "key length");
+   if(!allow_m

[OpenWrt-Devel] [PATCH] Add the option mppe-optional to pppd - 1/2

2009-06-24 Thread Alexander Stadler
Creates the patchfile which adds the option mppe-optional to pppd (File 
911-pppd-mppe-optional-new.patch, which I send as standalone in 2/2).
This fixes a "bug" of OSX to be able to connect with mppe (and not unencrypted 
only) when its set as option in pptpd. Also allow mppc only connections. And 
use mppe by default if set optionally on the client, instead of not using it by 
default then. ("mppe-optional" in combination with "mppe required" instead of 
"mppe" only)

Signed-off-by: Alexander Stadler 

--

diff -urN a/8.09/package/ppp/patches/911-pppd-mppe-optional-new.patch 
b/8.09/package/ppp/patches/911-pppd-mppe-optional-new.patch
--- a/8.09/package/ppp/patches/911-pppd-mppe-optional-new.patch 1970-01-01 
01:00:00.0 +0100
+++ b/8.09/package/ppp/patches/911-pppd-mppe-optional-new.patch 2009-05-04 
17:58:34.0 +0200
@@ -0,0 +1,151 @@
+diff -urN a/pppd/auth.c b/pppd/auth.c
+--- a/pppd/auth.c  2009-05-04 16:41:01.0 +0200
 b/pppd/auth.c  2009-05-04 16:42:46.0 +0200
+@@ -885,7 +885,7 @@
+  */
+ ecp_required = ecp_gotoptions[unit].required;
+ mppe_required = ccp_gotoptions[unit].mppe;
+-if (!ecp_required && !mppe_required)
++if (!ecp_required && (!mppe_required || allow_mppe_fallback))
+   continue_networks(unit);
+ }
+ 
+diff -urN a/pppd/ccp.c b/pppd/ccp.c
+--- a/pppd/ccp.c   2009-05-04 16:41:13.0 +0200
 b/pppd/ccp.c   2009-05-04 16:37:32.0 +0200
+@@ -136,6 +136,8 @@
+   "don't allow MPPE encryption" },
+ { "-mppe", o_special_noarg, (void *)setnomppe,
+   "don't allow MPPE encryption" },
++{ "mppe-optional", o_bool, &allow_mppe_fallback,
++  "allow falling back to unencrypted connection mode", OPT_PRIO | 1 },
+ #endif /* MPPE */
+ 
+ { NULL }
+@@ -623,8 +625,13 @@
+ 
+ #ifdef MPPE
+ if (ccp_wantoptions[unit].mppe) {
+-  error("MPPE required but peer negotiation failed");
+-  lcp_close(unit, "MPPE required but peer negotiation failed");
++  if(!allow_mppe_fallback) {
++  error("MPPE required but peer negotiation failed");
++  lcp_close(unit, "MPPE required but peer negotiation failed");
++  } else {
++  error("MPPE required but peer negotiation failed.  "
++"Falling back and disabling MPPE");
++  }
+ }
+ #endif /* MPPE */
+ }
+@@ -669,22 +676,41 @@
+   auth_mschap_bits >>= 1;
+   } while (auth_mschap_bits);
+   if (numbits > 1) {
+-  error("MPPE required, but auth done in both directions.");
+-  lcp_close(f->unit, "MPPE required but not available");
+-  return;
++  if(!allow_mppe_fallback) {
++  error("MPPE required, but auth done in both directions.");
++  lcp_close(f->unit, "MPPE required but not available");
++  return;
++  } else {
++  go->mppe = 0;
++  error("MPPE required, but auth done in both directions.  "
++"Falling back and disabling MPPE");
++  }
+   }
+   if (!numbits) {
+-  error("MPPE required, but MS-CHAP[v2] auth not performed.");
+-  lcp_close(f->unit, "MPPE required but not available");
+-  return;
++  if(!allow_mppe_fallback) {
++  error("MPPE required, but MS-CHAP[v2] auth not performed.");
++  lcp_close(f->unit, "MPPE required but not available");
++  return;
++  } else {
++  go->mppe = 0;
++  error("MPPE required, but MS-CHAP[v2] auth not performed.  "
++"Falling back and disabling MPPE");
++  }
+   }
+ 
+   /* A plugin (eg radius) may not have obtained key material. */
+   if (!mppe_keys_set) {
+-  error("MPPE required, but keys are not available.  "
+-"Possible plugin problem?");
+-  lcp_close(f->unit, "MPPE required but not available");
+-  return;
++  if(!allow_mppe_fallback) {
++  error("MPPE required, but keys are not available.  "
++"Possible plugin problem?");
++  lcp_close(f->unit, "MPPE required but not available");
++  return;
++  } else {
++  go->mppe = 0;
++  error("MPPE required, but keys are not available.  "
++"Possible plugin problem?  "

[OpenWrt-Devel] [PATCH] Adds mppc (compression) support to ppp 2.4.4 (as it was in 2.4.3) - 2/2

2009-06-24 Thread Alexander Stadler
Adds support for mppc (compression) to ppp 2.4.4.

Signed-off-by: Alexander Stadler 

--

diff -urN ppp-2.4.4.orig/include/linux/ppp-comp.h 
ppp-2.4.4/include/linux/ppp-comp.h
--- ppp-2.4.4.orig/include/linux/ppp-comp.h 2002-12-06 12:49:15.0 
+0300
+++ ppp-2.4.4/include/linux/ppp-comp.h  2006-07-20 13:15:08.0 +0400
@@ -36,7 +36,7 @@
  */
 
 /*
- *  ==FILEVERSION 20020319==
+ *  ==FILEVERSION 20020715==
  *
  *  NOTE TO MAINTAINERS:
  * If you modify this file at all, please set the above date.
@@ -86,7 +86,7 @@
 
/* Compress a packet */
int (*compress) (void *state, unsigned char *rptr,
- unsigned char *obuf, int isize, int osize);
+unsigned char *obuf, int isize, int osize);
 
/* Return compression statistics */
void(*comp_stat) (void *state, struct compstat *stats);
@@ -107,7 +107,7 @@
 
/* Decompress a packet. */
int (*decompress) (void *state, unsigned char *ibuf, int isize,
-   unsigned char *obuf, int osize);
+  unsigned char *obuf, int osize);
 
/* Update state for an incompressible packet received */
void(*incomp) (void *state, unsigned char *ibuf, int icnt);
@@ -288,6 +288,33 @@
opts |= MPPE_OPT_UNKNOWN;   \
 } while (/* CONSTCOND */ 0)
 
+/* MPPE/MPPC definitions by J.D.*/
+#define MPPE_STATELESS  MPPE_H_BIT /* configuration bit H */
+#define MPPE_40BIT  MPPE_L_BIT /* configuration bit L */
+#define MPPE_56BIT  MPPE_M_BIT /* configuration bit M */
+#define MPPE_128BIT MPPE_S_BIT /* configuration bit S */
+#define MPPE_MPPC   MPPE_C_BIT /* configuration bit C */
+
+/*
+ * Definitions for Stac LZS.
+ */
+
+#define CI_LZS 17  /* config option for Stac LZS */
+#define CILEN_LZS  5   /* length of config option */
+
+#define LZS_OVHD   4   /* max. LZS overhead */
+#define LZS_HIST_LEN   2048/* LZS history size */
+#define LZS_MAX_CCOUNT 0x0FFF  /* max. coherency counter value */
+
+#define LZS_MODE_NONE  0
+#define LZS_MODE_LCB   1
+#define LZS_MODE_CRC   2
+#define LZS_MODE_SEQ   3
+#define LZS_MODE_EXT   4
+
+#define LZS_EXT_BIT_FLUSHED0x80/* bit A */
+#define LZS_EXT_BIT_COMP   0x20/* bit C */
+
 /*
  * Definitions for other, as yet unsupported, compression methods.
  */
diff -urN ppp-2.4.4.orig/include/net/ppp-comp.h ppp-2.4.4/include/net/ppp-comp.h
--- ppp-2.4.4.orig/include/net/ppp-comp.h   2002-12-06 12:49:15.0 
+0300
+++ ppp-2.4.4/include/net/ppp-comp.h2006-07-20 13:15:08.0 +0400
@@ -255,6 +255,33 @@
opts |= MPPE_OPT_UNKNOWN;   \
 } while (/* CONSTCOND */ 0)
 
+/* MPPE/MPPC definitions by J.D.*/
+#define MPPE_STATELESS  MPPE_H_BIT /* configuration bit H */
+#define MPPE_40BIT  MPPE_L_BIT /* configuration bit L */
+#define MPPE_56BIT  MPPE_M_BIT /* configuration bit M */
+#define MPPE_128BIT MPPE_S_BIT /* configuration bit S */
+#define MPPE_MPPC   MPPE_C_BIT /* configuration bit C */
+
+/*
+ * Definitions for Stac LZS.
+ */
+
+#define CI_LZS 17  /* config option for Stac LZS */
+#define CILEN_LZS  5   /* length of config option */
+
+#define LZS_OVHD   4   /* max. LZS overhead */
+#define LZS_HIST_LEN   2048/* LZS history size */
+#define LZS_MAX_CCOUNT 0x0FFF  /* max. coherency counter value */
+
+#define LZS_MODE_NONE  0
+#define LZS_MODE_LCB   1
+#define LZS_MODE_CRC   2
+#define LZS_MODE_SEQ   3
+#define LZS_MODE_EXT   4
+
+#define LZS_EXT_BIT_FLUSHED0x80/* bit A */
+#define LZS_EXT_BIT_COMP   0x20/* bit C */
+
 /*
  * Definitions for other, as yet unsupported, compression methods.
  */
diff -urN ppp-2.4.4.orig/pppd/ccp.c ppp-2.4.4/pppd/ccp.c
--- ppp-2.4.4.orig/pppd/ccp.c   2005-07-09 04:23:05.0 +0400
+++ ppp-2.4.4/pppd/ccp.c2006-07-20 13:55:23.0 +0400
@@ -62,12 +62,10 @@
 static char bsd_value[8];
 static char deflate_value[8];
 
-/*
- * Option variables.
- */
 #ifdef MPPE
-bool refuse_mppe_stateful = 1; /* Allow stateful mode? */
-#endif
+static int setmppe(char **);
+static int setnomppe(void);
+#endif /* MPPE */
 
 static option_t ccp_option_list[] = {
 { "noccp", o_bool, &ccp_protent.enabled_flag,
@@ -108,54 +106,36 @@
   "don't allow Predictor-1", OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLR,
   &ccp_allowoptions[0].predictor_1 },
 
+{ "lzs", o_bool, &ccp_wantoptions[0].lzs,
+  "request Stac LZS", 1, &ccp_allowoptions[0].lzs, OPT_PRIO },
+{ "+lzs", o_bool, &ccp_wantoption

[OpenWrt-Devel] [PATCH] Adds mppc (compression) support to ppp 2.4.4 (as it was in 2.4.3) - 1/2

2009-06-24 Thread Alexander Stadler
Creates the patchfile which adds support for mppc (compression) to ppp 2.4.4 
(File 901-mppe-mppc-1.1.patch, which I send as standalone in 2/2).

Signed-off-by: Alexander Stadler 

--

diff -urN a/8.09/package/ppp/patches/901-mppe-mppc-1.1.patch 
b/8.09/package/ppp/patches/901-mppe-mppc-1.1.patch
--- a/8.09/package/ppp/patches/901-mppe-mppc-1.1.patch  1970-01-01 
01:00:00.0 +0100
+++ b/8.09/package/ppp/patches/901-mppe-mppc-1.1.patch  2009-04-28 
12:02:12.0 +0200
@@ -0,0 +1,1591 @@
+diff -urN ppp-2.4.4.orig/include/linux/ppp-comp.h 
ppp-2.4.4/include/linux/ppp-comp.h
+--- ppp-2.4.4.orig/include/linux/ppp-comp.h2002-12-06 12:49:15.0 
+0300
 ppp-2.4.4/include/linux/ppp-comp.h 2006-07-20 13:15:08.0 +0400
+@@ -36,7 +36,7 @@
+  */
+ 
+ /*
+- *  ==FILEVERSION 20020319==
++ *  ==FILEVERSION 20020715==
+  *
+  *  NOTE TO MAINTAINERS:
+  * If you modify this file at all, please set the above date.
+@@ -86,7 +86,7 @@
+ 
+   /* Compress a packet */
+   int (*compress) (void *state, unsigned char *rptr,
+-unsigned char *obuf, int isize, int osize);
++   unsigned char *obuf, int isize, int osize);
+ 
+   /* Return compression statistics */
+   void(*comp_stat) (void *state, struct compstat *stats);
+@@ -107,7 +107,7 @@
+ 
+   /* Decompress a packet. */
+   int (*decompress) (void *state, unsigned char *ibuf, int isize,
+-  unsigned char *obuf, int osize);
++ unsigned char *obuf, int osize);
+ 
+   /* Update state for an incompressible packet received */
+   void(*incomp) (void *state, unsigned char *ibuf, int icnt);
+@@ -288,6 +288,33 @@
+   opts |= MPPE_OPT_UNKNOWN;   \
+ } while (/* CONSTCOND */ 0)
+ 
++/* MPPE/MPPC definitions by J.D.*/
++#define MPPE_STATELESS  MPPE_H_BIT/* configuration bit H */
++#define MPPE_40BIT  MPPE_L_BIT/* configuration bit L */
++#define MPPE_56BIT  MPPE_M_BIT/* configuration bit M */
++#define MPPE_128BIT MPPE_S_BIT/* configuration bit S */
++#define MPPE_MPPC   MPPE_C_BIT/* configuration bit C */
++
++/*
++ * Definitions for Stac LZS.
++ */
++
++#define CI_LZS17  /* config option for Stac LZS */
++#define CILEN_LZS 5   /* length of config option */
++
++#define LZS_OVHD  4   /* max. LZS overhead */
++#define LZS_HIST_LEN  2048/* LZS history size */
++#define LZS_MAX_CCOUNT0x0FFF  /* max. coherency counter value 
*/
++
++#define LZS_MODE_NONE 0
++#define LZS_MODE_LCB  1
++#define LZS_MODE_CRC  2
++#define LZS_MODE_SEQ  3
++#define LZS_MODE_EXT  4
++
++#define LZS_EXT_BIT_FLUSHED   0x80/* bit A */
++#define LZS_EXT_BIT_COMP  0x20/* bit C */
++
+ /*
+  * Definitions for other, as yet unsupported, compression methods.
+  */
+diff -urN ppp-2.4.4.orig/include/net/ppp-comp.h 
ppp-2.4.4/include/net/ppp-comp.h
+--- ppp-2.4.4.orig/include/net/ppp-comp.h  2002-12-06 12:49:15.0 
+0300
 ppp-2.4.4/include/net/ppp-comp.h   2006-07-20 13:15:08.0 +0400
+@@ -255,6 +255,33 @@
+   opts |= MPPE_OPT_UNKNOWN;   \
+ } while (/* CONSTCOND */ 0)
+ 
++/* MPPE/MPPC definitions by J.D.*/
++#define MPPE_STATELESS  MPPE_H_BIT/* configuration bit H */
++#define MPPE_40BIT  MPPE_L_BIT/* configuration bit L */
++#define MPPE_56BIT  MPPE_M_BIT/* configuration bit M */
++#define MPPE_128BIT MPPE_S_BIT/* configuration bit S */
++#define MPPE_MPPC   MPPE_C_BIT/* configuration bit C */
++
++/*
++ * Definitions for Stac LZS.
++ */
++
++#define CI_LZS17  /* config option for Stac LZS */
++#define CILEN_LZS 5   /* length of config option */
++
++#define LZS_OVHD  4   /* max. LZS overhead */
++#define LZS_HIST_LEN  2048/* LZS history size */
++#define LZS_MAX_CCOUNT0x0FFF  /* max. coherency counter value 
*/
++
++#define LZS_MODE_NONE 0
++#define LZS_MODE_LCB  1
++#define LZS_MODE_CRC  2
++#define LZS_MODE_SEQ  3
++#define LZS_MODE_EXT  4
++
++#define LZS_EXT_BIT_FLUSHED   0x80/* bit A */
++#define LZS_EXT_BIT_COMP  0x20/* bit C */
++
+ /*
+  * Definitions for other, as yet unsupported, compression methods.
+  */
+diff -urN ppp-2.4.4.orig/pppd/ccp.c ppp-2.4.4/pppd/ccp.c
+--- ppp-2.4.4.orig/pppd/ccp.c  2005-07-09 04:23:05.0 +0400
 ppp-2.4.4/pppd/ccp.c   2006-07-20 13:55:23.0 +0400
+@@ -62,12 +62,10 @@
+ static char bsd_value[8];
+ static char deflate_value[8];
+ 
+-/*
+- * Option variables.
+- */
+ #ifdef MPPE
+-bool refuse_mppe_stateful = 1;/* Allow stateful mode? */
+-#endif
++static int setmppe(char

[OpenWrt-Devel] [PATCH] Changes reboot=bios to reboot=acpi on x86

2009-06-24 Thread Alexander Stadler
Changes reboot=bios to reboot=acpi on x86.
I'm doing this because reboot=bios lets paravirtualized maschines hang when 
trieing to reboot (and I would recommend to add acpi when using x86, but reboot 
also works with this option when acpi is not enabled).

Signed-off-by: Alexander Stadler 

--

diff -urN a/8.09/target/linux/x86/image/menu.lst 
b/8.09/target/linux/x86/image/menu.lst
--- a/8.09/target/linux/x86/image/menu.lst  2009-04-08 17:00:41.0 
+0200
+++ b/8.09/target/linux/x86/image/menu.lst  2009-04-16 17:55:52.0 
+0200
@@ -6,10 +6,10 @@
 
 title   OpenWrt
 root(hd0,0)
-kernel  /boot/vmlinuz @CMDLINE@ noinitrd console=tty0 
console=ttyS0,@baudr...@n8 reboot=bios
+kernel  /boot/vmlinuz @CMDLINE@ noinitrd console=tty0 
console=ttyS0,@baudr...@n8 reboot=acpi
 boot
 
 title  OpenWrt (failsafe)
 root   (hd0,0)
-kernel  /boot/vmlinuz failsafe=true @CMDLINE@ noinitrd console=tty0 
console=ttyS0,@baudr...@n8 reboot=bios
+kernel  /boot/vmlinuz failsafe=true @CMDLINE@ noinitrd console=tty0 
console=ttyS0,@baudr...@n8 reboot=acpi
 boot



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


[OpenWrt-Devel] [PATCH] Lowers the priority of clocksource tsc below acpi in kernel.2.6.25 - 2/2

2009-06-24 Thread Alexander Stadler
Lowers the "priority" of clocksource tsc below acpi on x86 systems.
I'm doing this, because tsc is not stable on virtualized machines nor on smp 
systems, and so acpi gets selected instead of tsc and then jiffies (if acpi is 
built in, which I would recommend for x86).

Signed-off-by: Alexander Stadler 

--

diff -urN openwrt-8.09/arch/x86/kernel/tsc_32.c openwrt/arch/x86/kernel/tsc_32.c
--- a/arch/x86/kernel/tsc_32.c  2008-09-08 12:20:51.0 +0200
+++ b/arch/x86/kernel/tsc_32.c  2009-04-17 11:55:40.0 +0200
@@ -297,7 +297,7 @@
 
 static struct clocksource clocksource_tsc = {
.name   = "tsc",
-   .rating = 300,
+   .rating = 199,
.read   = read_tsc,
.mask   = CLOCKSOURCE_MASK(64),
.mult   = 0, /* to be set */
diff -urN openwrt-8.09/arch/x86/kernel/tsc_64.c openwrt/arch/x86/kernel/tsc_64.c
--- a/arch/x86/kernel/tsc_64.c  2008-09-08 12:20:51.0 +0200
+++ b/arch/x86/kernel/tsc_64.c  2009-04-17 11:55:42.0 +0200
@@ -305,7 +305,7 @@
 
 static struct clocksource clocksource_tsc = {
.name   = "tsc",
-   .rating = 300,
+   .rating = 199,
.read   = read_tsc,
.mask   = CLOCKSOURCE_MASK(64),
.shift  = 22,




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


[OpenWrt-Devel] [PATCH] Corrects a (memory) bug of the paravirtualization feature in kernel.2.6.25 - 2/2

2009-06-24 Thread Alexander Stadler
Corrects a (memory) bug of the paravirtualization feature in kernel 2.6.25 
(which got corrected later in 2.6.29).

Signed-off-by: Alexander Stadler 

--

diff -urN openwrt-8.09/arch/x86/xen/enlighten.c openwrt/arch/x86/xen/enlighten.c
--- a/arch/x86/xen/enlighten.c  2008-09-08 12:20:51.0 +0200
+++ b/arch/x86/xen/enlighten.c  2009-04-03 14:27:56.0 +0200
@@ -1059,6 +1059,8 @@
.pte_update = paravirt_nop,
.pte_update_defer = paravirt_nop,
 
+   .pgd_free = paravirt_nop,
+
.alloc_pt = xen_alloc_pt_init,
.release_pt = xen_release_pt_init,
.alloc_pd = xen_alloc_pt_init,
diff -urN openwrt-8.09/arch/x86/kernel/paravirt.c 
openwrt/arch/x86/kernel/paravirt.c
--- a/arch/x86/kernel/paravirt.c2008-09-08 12:20:51.0 +0200
+++ b/arch/x86/kernel/paravirt.c2009-04-03 14:27:56.0 +0200
@@ -382,6 +382,8 @@
.flush_tlb_single = native_flush_tlb_single,
.flush_tlb_others = native_flush_tlb_others,
 
+   .pgd_free = paravirt_nop,
+
.alloc_pt = paravirt_nop,
.alloc_pd = paravirt_nop,
.alloc_pd_clone = paravirt_nop,
diff -urN openwrt-8.09/include/asm-x86/paravirt.h 
openwrt/include/asm-x86/paravirt.h
--- a/include/asm-x86/paravirt.h2008-09-08 12:20:51.0 +0200
+++ b/include/asm-x86/paravirt.h2009-04-03 14:27:56.0 +0200
@@ -219,6 +219,9 @@
void (*flush_tlb_others)(const cpumask_t *cpus, struct mm_struct *mm,
 unsigned long va);
 
+   /* Hook for freeing a pagetable top-level */
+   void (*pgd_free) (struct mm_struct *mm, pgd_t *pgd);
+
/* Hooks for allocating/releasing pagetable pages */
void (*alloc_pt)(struct mm_struct *mm, u32 pfn);
void (*alloc_pd)(struct mm_struct *mm, u32 pfn);
@@ -894,6 +897,11 @@
PVOP_VCALL3(pv_mmu_ops.flush_tlb_others, &cpumask, mm, va);
 }
 
+static inline void paravirt_pgd_free(struct mm_struct *mm, pgd_t *pgd)
+{
+ PVOP_VCALL2(pv_mmu_ops.pgd_free, mm, pgd);
+}
+
 static inline void paravirt_alloc_pt(struct mm_struct *mm, unsigned pfn)
 {
PVOP_VCALL2(pv_mmu_ops.alloc_pt, mm, pfn);
diff -urN openwrt-8.09/include/asm-x86/pgalloc_32.h 
openwrt/include/asm-x86/pgalloc_32.h
--- a/include/asm-x86/pgalloc_32.h  2008-09-08 12:20:51.0 +0200
+++ b/include/asm-x86/pgalloc_32.h  2009-04-03 14:27:56.0 +0200
@@ -13,6 +13,7 @@
 #define paravirt_alloc_pt(mm, pfn) do { } while (0)
 #define paravirt_alloc_pd(mm, pfn) do { } while (0)
 #define paravirt_alloc_pd_clone(pfn, clonepfn, start, count) do { } while (0)
+#define paravirt_pgd_free(mm, pgd) do { } while (0)
 #define paravirt_release_pt(pfn) do { } while (0)
 #define paravirt_release_pd(pfn) do { } while (0)
 #endif
diff -urN openwrt-8.09/arch/x86/mm/pgtable_32.c openwrt/arch/x86/mm/pgtable_32.c
--- a/arch/x86/mm/pgtable_32.c  2008-09-08 12:20:51.0 +0200
+++ b/arch/x86/mm/pgtable_32.c  2009-04-03 14:27:56.0 +0200
@@ -351,6 +351,7 @@
 
if (pgd && !pgd_prepopulate_pmd(mm, pgd)) {
pgd_dtor(pgd);
+   paravirt_pgd_free(mm, pgd);
free_page((unsigned long)pgd);
pgd = NULL;
}
@@ -362,6 +363,7 @@
 {
pgd_mop_up_pmds(mm, pgd);
pgd_dtor(pgd);
+   paravirt_pgd_free(mm, pgd);
free_page((unsigned long)pgd);
 }
 
diff -urN openwrt-8.09/arch/x86/kernel/vmi_32.c openwrt/arch/x86/kernel/vmi_32.c
--- a/arch/x86/kernel/vmi_32.c  2008-09-08 12:20:51.0 +0200
+++ b/arch/x86/kernel/vmi_32.c  2009-04-03 14:27:56.0 +0200
@@ -428,6 +428,16 @@
vmi_set_page_type(pfn, VMI_PAGE_NORMAL);
 }
 
+/*
+ * We use the pgd_free hook for releasing the pgd page:
+ */
+static void vmi_pgd_free(struct mm_struct *mm, pgd_t *pgd)
+{
+ unsigned long pfn = __pa(pgd) >> PAGE_SHIFT;
+
+ vmi_ops.release_page(pfn, VMI_PAGE_L2);
+}
+
 /*
  * Helper macros for MMU update flags.  We can defer updates until a flush
  * or page invalidation only if the update is to the current address space
@@ -880,6 +890,7 @@
if (vmi_ops.release_page) {
pv_mmu_ops.release_pt = vmi_release_pt;
pv_mmu_ops.release_pd = vmi_release_pd;
+   pv_mmu_ops.pgd_free = vmi_pgd_free;
}
 
/* Set linear is needed in all cases */




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


[OpenWrt-Devel] [PATCH] Lowers the priority of clocksource tsc below acpi in kernel.2.6.25 - 1/2

2009-06-24 Thread Alexander Stadler
Creates the patchfile which lowers the "priority" of clocksource tsc below acpi 
on x86 systems (File 997-tsc_on_vm.patch, which I send as standalone in 2/2).
I'm doing this, because tsc is not stable on virtualized machines nor on smp 
systems, and so acpi gets selected instead of tsc and then jiffies (if acpi is 
built in, which I would recommend for x86).

Signed-off-by: Alexander Stadler 

--

diff -urN a/8.09/target/linux/generic-2.6/patches-2.6.25/997-tsc_on_vm.patch 
b/8.09/target/linux/generic-2.6/patches-2.6.25/997-tsc_on_vm.patch
--- a/8.09/target/linux/generic-2.6/patches-2.6.25/997-tsc_on_vm.patch  
1970-01-01 01:00:00.0 +0100
+++ b/8.09/target/linux/generic-2.6/patches-2.6.25/997-tsc_on_vm.patch  
2009-04-17 12:01:48.0 +0200
@@ -0,0 +1,24 @@
+diff -urN openwrt-8.09/arch/x86/kernel/tsc_32.c 
openwrt/arch/x86/kernel/tsc_32.c
+--- a/arch/x86/kernel/tsc_32.c 2008-09-08 12:20:51.0 +0200
 b/arch/x86/kernel/tsc_32.c 2009-04-17 11:55:40.0 +0200
+@@ -297,7 +297,7 @@
+ 
+ static struct clocksource clocksource_tsc = {
+   .name   = "tsc",
+-  .rating = 300,
++  .rating = 199,
+   .read   = read_tsc,
+   .mask   = CLOCKSOURCE_MASK(64),
+   .mult   = 0, /* to be set */
+diff -urN openwrt-8.09/arch/x86/kernel/tsc_64.c 
openwrt/arch/x86/kernel/tsc_64.c
+--- a/arch/x86/kernel/tsc_64.c 2008-09-08 12:20:51.0 +0200
 b/arch/x86/kernel/tsc_64.c 2009-04-17 11:55:42.0 +0200
+@@ -305,7 +305,7 @@
+ 
+ static struct clocksource clocksource_tsc = {
+   .name   = "tsc",
+-  .rating = 300,
++  .rating = 199,
+   .read   = read_tsc,
+   .mask   = CLOCKSOURCE_MASK(64),
+   .shift  = 22,




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


[OpenWrt-Devel] [PATCH] Corrects a (memory) bug of the paravirtualization feature in kernel.2.6.25 - 1/2

2009-06-24 Thread Alexander Stadler
Creates the patchfile which corrects a (memory) bug of the paravirtualization 
feature in kernel 2.6.25 (which got corrected later in 2.6.29) (File 
998-paravirt_release_pmd.patch, which I send as standalone in 2/2)

Signed-off-by: Alexander Stadler 

--

diff -urN 
a/8.09/target/linux/generic-2.6/patches-2.6.25/998-paravirt_release_pmd.patch 
b/8.09/target/linux/generic-2.6/patches-2.6.25/998-paravirt_release_pmd.patch
--- 
a/8.09/target/linux/generic-2.6/patches-2.6.25/998-paravirt_release_pmd.patch   
1970-01-01 01:00:00.0 +0100
+++ 
b/8.09/target/linux/generic-2.6/patches-2.6.25/998-paravirt_release_pmd.patch   
2009-04-03 15:10:30.0 +0200
@@ -0,0 +1,107 @@
+diff -urN openwrt-8.09/arch/x86/xen/enlighten.c 
openwrt/arch/x86/xen/enlighten.c
+--- a/arch/x86/xen/enlighten.c 2008-09-08 12:20:51.0 +0200
 b/arch/x86/xen/enlighten.c 2009-04-03 14:27:56.0 +0200
+@@ -1059,6 +1059,8 @@
+   .pte_update = paravirt_nop,
+   .pte_update_defer = paravirt_nop,
+ 
++  .pgd_free = paravirt_nop,
++
+   .alloc_pt = xen_alloc_pt_init,
+   .release_pt = xen_release_pt_init,
+   .alloc_pd = xen_alloc_pt_init,
+diff -urN openwrt-8.09/arch/x86/kernel/paravirt.c 
openwrt/arch/x86/kernel/paravirt.c
+--- a/arch/x86/kernel/paravirt.c   2008-09-08 12:20:51.0 +0200
 b/arch/x86/kernel/paravirt.c   2009-04-03 14:27:56.0 +0200
+@@ -382,6 +382,8 @@
+   .flush_tlb_single = native_flush_tlb_single,
+   .flush_tlb_others = native_flush_tlb_others,
+ 
++  .pgd_free = paravirt_nop,
++
+   .alloc_pt = paravirt_nop,
+   .alloc_pd = paravirt_nop,
+   .alloc_pd_clone = paravirt_nop,
+diff -urN openwrt-8.09/include/asm-x86/paravirt.h 
openwrt/include/asm-x86/paravirt.h
+--- a/include/asm-x86/paravirt.h   2008-09-08 12:20:51.0 +0200
 b/include/asm-x86/paravirt.h   2009-04-03 14:27:56.0 +0200
+@@ -219,6 +219,9 @@
+   void (*flush_tlb_others)(const cpumask_t *cpus, struct mm_struct *mm,
+unsigned long va);
+ 
++  /* Hook for freeing a pagetable top-level */
++  void (*pgd_free) (struct mm_struct *mm, pgd_t *pgd);
++
+   /* Hooks for allocating/releasing pagetable pages */
+   void (*alloc_pt)(struct mm_struct *mm, u32 pfn);
+   void (*alloc_pd)(struct mm_struct *mm, u32 pfn);
+@@ -894,6 +897,11 @@
+   PVOP_VCALL3(pv_mmu_ops.flush_tlb_others, &cpumask, mm, va);
+ }
+ 
++static inline void paravirt_pgd_free(struct mm_struct *mm, pgd_t *pgd)
++{
++ PVOP_VCALL2(pv_mmu_ops.pgd_free, mm, pgd);
++}
++
+ static inline void paravirt_alloc_pt(struct mm_struct *mm, unsigned pfn)
+ {
+   PVOP_VCALL2(pv_mmu_ops.alloc_pt, mm, pfn);
+diff -urN openwrt-8.09/include/asm-x86/pgalloc_32.h 
openwrt/include/asm-x86/pgalloc_32.h
+--- a/include/asm-x86/pgalloc_32.h 2008-09-08 12:20:51.0 +0200
 b/include/asm-x86/pgalloc_32.h 2009-04-03 14:27:56.0 +0200
+@@ -13,6 +13,7 @@
+ #define paravirt_alloc_pt(mm, pfn) do { } while (0)
+ #define paravirt_alloc_pd(mm, pfn) do { } while (0)
+ #define paravirt_alloc_pd_clone(pfn, clonepfn, start, count) do { } while (0)
++#define paravirt_pgd_free(mm, pgd) do { } while (0)
+ #define paravirt_release_pt(pfn) do { } while (0)
+ #define paravirt_release_pd(pfn) do { } while (0)
+ #endif
+diff -urN openwrt-8.09/arch/x86/mm/pgtable_32.c 
openwrt/arch/x86/mm/pgtable_32.c
+--- a/arch/x86/mm/pgtable_32.c 2008-09-08 12:20:51.0 +0200
 b/arch/x86/mm/pgtable_32.c 2009-04-03 14:27:56.0 +0200
+@@ -351,6 +351,7 @@
+ 
+   if (pgd && !pgd_prepopulate_pmd(mm, pgd)) {
+   pgd_dtor(pgd);
++  paravirt_pgd_free(mm, pgd);
+   free_page((unsigned long)pgd);
+   pgd = NULL;
+   }
+@@ -362,6 +363,7 @@
+ {
+   pgd_mop_up_pmds(mm, pgd);
+   pgd_dtor(pgd);
++  paravirt_pgd_free(mm, pgd);
+   free_page((unsigned long)pgd);
+ }
+ 
+diff -urN openwrt-8.09/arch/x86/kernel/vmi_32.c 
openwrt/arch/x86/kernel/vmi_32.c
+--- a/arch/x86/kernel/vmi_32.c 2008-09-08 12:20:51.0 +0200
 b/arch/x86/kernel/vmi_32.c 2009-04-03 14:27:56.0 +0200
+@@ -428,6 +428,16 @@
+   vmi_set_page_type(pfn, VMI_PAGE_NORMAL);
+ }
+ 
++/*
++ * We use the pgd_free hook for releasing the pgd page:
++ */
++static void vmi_pgd_free(struct mm_struct *mm, pgd_t *pgd)
++{
++ unsigned long pfn = __pa(pgd) >> PAGE_SHIFT;
++
++ vmi_ops.release_page(pfn, VMI_PAGE_L2);
++}
++
+ /*
+  * Helper macros for MMU update flags.  We can defer updates until a flush
+  * or page invalidation only if the update is to the current address space
+@@ -880,6 +890,7 @@
+   if (vmi_ops.release_page) {
+   pv_mmu_ops.release_pt = vmi_release_pt;
+   pv_mmu_ops.release_pd = vmi_release_pd;
++  pv_mmu_ops.pgd_free = vmi_pgd_free;
+   }
+ 
+   /* Set linear is n