Re: [OpenWrt-Devel] lantiq: ath_pci_fixup cannot work since it's called before ath9k_eeprom_probe

2013-09-09 Thread John Crispin

On 08/09/13 18:50, Luca Olivetti wrote:

Al 08/09/13 18:08, En/na Luca Olivetti ha escrit:

As per the subject, the function ath_pci_fixup (in
arch/mips/lantiq/xway/pci-ath-fixup.c) is called very early in the boot
process, before ath9k_eeprom_probe (in arch/mips/lantiq/xway/ath_eep.c)
has had any possibility to call ltq_pci_ath_fixup.
The net result is that the fixup isn't done and the wireless adapter
doesn't work.
What can I change to revert the order of those calls? (i'm lost in the
75 levels of indirection, I had it working 3 years ago but then the
levels of indirection where only 63 ;-)


Found the solution, change the call from

late_initcall(of_ath9k_eeprom_init)

to

subsys_initcall(of_ath9k_eeprom_init).


Now I have to see why it doesn't get the mac address and the regdomain
from the eeprom (things, again, that I had working but it seems this
platform is an easy target for being broken again and again).

Bye



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



this is wrong. the eeprom needs to be probed after spi.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 001/001] [brcm47xx] board detection, GPIO for Linksys E1000 V2.1

2013-09-09 Thread Zachary Catlin

From: Zachary Catlin zcat...@indiana.edu

This patch adds board detection for the Linksys E1000 V2.1 router, as well
as GPIO support for same.

Signed-off-by: Zachary Catlin zcat...@indiana.edu
---
This fixes bug #14135. Currently, wired networking isn't working
on the router, and I haven't tried the wireless, but with this
patch, OpenWRT successfully boots, and all the LEDs and buttons
work properly.

===
--- 
target/linux/brcm47xx/patches-3.10/260-MIPS-BCM47XX-add-board-detection.patch	(revision 
37919)
+++ 
target/linux/brcm47xx/patches-3.10/260-MIPS-BCM47XX-add-board-detection.patch	(working 
copy)

@@ -8,7 +8,7 @@
 obj-$(CONFIG_BCM47XX_SSB)  += wgt634u.o
--- /dev/null
+++ b/arch/mips/bcm47xx/board.c
-@@ -0,0 +1,240 @@
+@@ -0,0 +1,241 @@
+#include linux/export.h
+#include linux/string.h
+#include bcm47xx_board.h
@@ -101,6 +101,7 @@
+	{{BCM47XX_BOARD_CISCO_M20V1, Cisco M20}, M20, 1.0}, /* like 
WRT310N v2.0 */
+	{{BCM47XX_BOARD_LINKSYS_E1000V1, Linksys E1000 V1}, E100, 1.0}, 
 /* like WRT160N v3.0 */

+   {{BCM47XX_BOARD_LINKSYS_E1000V2, Linksys E1000 V2}, E1000, 2.0},
++  {{BCM47XX_BOARD_LINKSYS_E1000V21, Linksys E1000 V2.1}, E1000, 
2.1},
+	{{BCM47XX_BOARD_LINKSYS_E2000V1, Linksys E2000 V1}, Linksys 
E2000, 1.0},
+	{{BCM47XX_BOARD_LINKSYS_E3000V1, Linksys E3000 V1}, E300, 1.0}, 
/* like WRT610N v2.0 */

+   {{BCM47XX_BOARD_LINKSYS_E3200V1, Linksys E3200 V1}, E3200, 1.0},
@@ -251,7 +252,7 @@
+EXPORT_SYMBOL(bcm47xx_board_get_name);
--- /dev/null
+++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
-@@ -0,0 +1,97 @@
+@@ -0,0 +1,98 @@
+#ifndef __BCM47XX_BOARD_H
+#define __BCM47XX_BOARD_H
+
@@ -302,6 +303,7 @@
+
+   BCM47XX_BOARD_LINKSYS_E1000V1,
+   BCM47XX_BOARD_LINKSYS_E1000V2,
++  BCM47XX_BOARD_LINKSYS_E1000V21,
+   BCM47XX_BOARD_LINKSYS_E2000V1,
+   BCM47XX_BOARD_LINKSYS_E3000V1,
+   BCM47XX_BOARD_LINKSYS_E3200V1,
Index: package/kernel/broadcom-diag/src/diag.c
===
--- package/kernel/broadcom-diag/src/diag.c (revision 37919)
+++ package/kernel/broadcom-diag/src/diag.c (working copy)
@@ -89,6 +89,7 @@
WRT610N,
WRT610NV2,
E1000V1,
+   E1000V21,
E3000V1,
E3200V1,
E4200V1,
@@ -471,6 +472,19 @@
			{ .name = ses_orange, .gpio = 1  2, .polarity = REVERSE }, /* 
nvram get gpio2=wps_status_led */

},
},
+   [E1000V21] = {
+   .name   = Linksys E1000 V2.1,
+   .buttons= {
+   { .name = reset,.gpio = 1  10 }, /* nvram get 
reset_gpio=10 */
+   { .name = wps,  .gpio = 1  9 }, /* nvram get 
gpio9=wps_button */
+   },
+   .leds   = {
+   { .name = power,  .gpio = 1  6, .polarity = 
REVERSE },
+   { .name = wlan,   .gpio = 1  5, .polarity = 
NORMAL },
+			{ .name = ses_blue,	.gpio = 1  8, .polarity = NORMAL }, /* 
nvram get gpio8=wps_led */
+			{ .name = ses_orange,	.gpio = 1  7, .polarity = NORMAL }, /* 
nvram get gpio7=wps_status_led */

+   },
+   },
[E3000V1] = {
.name   = Linksys E3000 V1,
.buttons= {
@@ -1349,6 +1363,8 @@
return platforms[DIR330];
case BCM47XX_BOARD_LINKSYS_E1000V1:
return platforms[E1000V1];
+   case BCM47XX_BOARD_LINKSYS_E1000V21:
+   return platforms[E1000V21];
case BCM47XX_BOARD_LINKSYS_E3000V1:
return platforms[E3000V1];
case BCM47XX_BOARD_LINKSYS_E3200V1:
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] getting more randomness by improving MIPS get_cycles()

2013-09-09 Thread John Crispin

On 08/09/13 21:04, Dave Taht wrote:

So, what blocks having a working get_cycles in common mips architectures?



Dave,

wrong mailing list. please post this on lmo

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


Re: [OpenWrt-Devel] lantiq: ath_pci_fixup cannot work since it's called before ath9k_eeprom_probe

2013-09-09 Thread Luca Olivetti
Al 09/09/13 08:01, En/na John Crispin ha escrit:
 On 08/09/13 18:50, Luca Olivetti wrote:
 Al 08/09/13 18:08, En/na Luca Olivetti ha escrit:
 As per the subject, the function ath_pci_fixup (in
 arch/mips/lantiq/xway/pci-ath-fixup.c) is called very early in the boot
 process, before ath9k_eeprom_probe (in arch/mips/lantiq/xway/ath_eep.c)
 has had any possibility to call ltq_pci_ath_fixup.
 The net result is that the fixup isn't done and the wireless adapter
 doesn't work.
 What can I change to revert the order of those calls? (i'm lost in the
 75 levels of indirection, I had it working 3 years ago but then the
 levels of indirection where only 63 ;-)

 Found the solution, change the call from

 late_initcall(of_ath9k_eeprom_init)

 to

 subsys_initcall(of_ath9k_eeprom_init).


 Now I have to see why it doesn't get the mac address and the regdomain
 from the eeprom (things, again, that I had working but it seems this
 platform is an easy target for being broken again and again).

 Bye



 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
 
 
 this is wrong. the eeprom needs to be probed after spi.

I don't know if it's right or wrong, I *do* know that this way it works,
with late_initcall it doesn't.
I see that before revision 36778 (probably the one that broke it) it was
arch_initcall.
What I'm sure about is that the eeprom must be probed *before* pci fixup
(re-read the first message that explains the problem).

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


[OpenWrt-Devel] Developer update

2013-09-09 Thread Gregers Petersen
There has been a few changes in the OpenWrt infrastructure recently and
several other things are in the development pipeline.

- dev.openwrt.org has been moved to a new server, which is the
intentional reason for the recent SSL key change. This will hopefully
solve some of the Trac performance issues.

- The OpenWrt team is focused on pushing all kernels to 3.10 by end of
September beginning of October. This is part of the process of getting
the 'Barrier Breaker' release ready. We would like to encourage everyone
to try their hand at forward porting targets and testing.

- An AA.1 update is on its way, and we hope that a public Release
Candidate can be ready in October.

- OpenWrt has be invited to be a guest at the FLOSS Weekly show
(twit.tv/show/floss-weekly) on the 18th of September.

Sincerely

-- 

 Gregers Petersen
 Relationship manager, layer 8 and anthropology
 glp on irc

  ___ __
 |   |.-.-.-.|  |  |  |..|  |_
 |   -   ||  _  |  -__| ||  |  |  ||   _||   _|
 |___||   __|_|__|__||||__|  ||
  |__| W I R E L E S S   F R E E D O M
 -
 BARRIER BREAKER (Bleeding Edge)
 -
  * 1/2 oz Galliano Pour all ingredients into
  * 4 oz cold Coffeean irish coffee mug filled
  * 1 1/2 oz Dark Rum   with crushed ice. Stir.
  * 2 tsp. Creme de Cacao
 -
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] redirect in uhttp

2013-09-09 Thread Bill Yuan
hi
I am using uhttpd, and I want to configure a page to handle all the
request. so it requires a redirection in for all the traffic. and I am
looking for the answer about how to achieve this .

in apache ,there is an rewrite module, and once config like below

RewriteEngine onRewriteRule   ^/(.+)  /index.php?url=$1  [R,L]

all the request to this server. e.g. to /abc.php will be redirect to
/index.php?url=abc.php
in this case, we can hand the index.php to handle all the request no matter
what URI you want.

Can we achieve this in uhttpd?

Best Regards,
Bill Yuan
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Un-softbricking Linksys E900 (bcm47xx) with CFE

2013-09-09 Thread Rafał Miłecki
I've installed firmware with broken network. It's useless, so I need
to install another firmware using CFE.

My CFE seems to run tftpd server for 3 seconds during boot:
 Waiting for 3 seconds to upgrade ...
 CMD: [load -raw -addr=0x807ae1b0 -max=0x1851e50 :]
 Loader:raw Filesys:tftp Dev:eth0 File:: Options:(null)
 Loading: _tftpd_open(): retries=0/3
 _tftpd_open(): retries=1/3
 _tftpd_open(): retries=2/3

So I simply decided to power my E900 on and start:
sudo /sbin/ifconfig eth0 192.168.1.2
tftp 192.168.1.1 -m binary -c put E900_v1.0.04.001_US_20120816.bin

It almost work... but with some error at the end :(

 Waiting for 3 seconds to upgrade ...
 CMD: [load -raw -addr=0x807ae1b0 -max=0x1851e50 :]
 Loader:raw Filesys:tftp Dev:eth0 File:: Options:(null)
 Loading: _tftpd_open(): retries=0/3
 _tftpd_open(): retries=1/3
  7123968 bytes read

 ### Start=291907748 E=-285817888 Delta=-577725636 ###
 Entry at 0x807ae1b0
 CMD: [boot -raw -z -addr=0x80001000 -max=0x1851e50 -fs=memory :0x807ae1b0]
 Loader:raw Filesys:memory Dev:eth0 File::0x807ae1b0 Options:(null)
 Loading: PANIC: out of memory!

I'm a bit confused... First of all CFE didn't write my image to the
flash. Secondly it failed to run it from the memory.

Any ideas?

I'm uploading manufacturer's firmware. It's 7123968B. I've also tried
uploading my own much smaller firmware which is only 5161984B but it
failed in the same way.

Unfortunately this Linksys compiledinstalled CFE without web server
or tftpd command, so I cant's use any of that 2 alternative methods.

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


Re: [OpenWrt-Devel] Un-softbricking Linksys E900 (bcm47xx) with CFE

2013-09-09 Thread Rafał Miłecki
2013/9/9 Rafał Miłecki zaj...@gmail.com:
 Unfortunately this Linksys compiledinstalled CFE without web server
 or tftpd command, so I cant's use any of that 2 alternative methods.

My CFE has 3 interesting commands: upgrade, flash and save (for the
full list see cfe.help.txt).

1) flash [options] source-file [destination-file]
Passing source-file is easy (like 192.168.1.2:/bin/code.bin), but I'm
not sure about destination-file.

 The destination-device parameter may be a flash device or an EEPROM. If not 
 specified, destination-device defaults to flash0, which is typically the boot 
 ROM.

If I don't pass anything as destination-file argument... Is CFE going
to write to the flash at offset 0x0? Overwriting itself? Or is it
going to write to the correct TRX offset? If it's going to use 0x0 by
default, should I pass -offset=value to avoid killing the CFE?

2) upgrade

It's not documented in my CFE manual.

3) save

It seems to be the opposite of flash. It reads some device memory
and saves it somewhere, for example in the remote TFTP server.

-- 
Rafał
CFE help
CMD: [help]
Available commands:

upgrade Upgrade Firmware
et  Broadcom Ethernet utility.
modify  Modify flash data.
nvram   NVRAM utility.
reboot  Reboot.
flash   Update a flash memory device
memtest Test memory.
f   Fill contents of memory.
e   Modify contents of memory.
d   Dump memory.
u   Disassemble instructions.
batch   Load a batch file into memory and execute it
go  Verify and boot OS image.
bootLoad an executable file into memory and execute it
loadLoad an executable file into memory without executing it
saveSave a region of memory to a remote file via TFTP
ttcpTCP test command.
tcp constesttcp console test.
tcp listen  port listener.
tcp connect TCP connection test.
rlogin  mini rlogin client.
client  Show the client of the dhcp server.
pingPing a remote IP host.
arp Display or modify the ARP Table
ifconfigConfigure the Ethernet interface
show clocks Show current values of the clocks.
show heap   Display information about CFE's heap
show memory Display the system physical memory map.
show devicesDisplay information about the installed devices.
unsetenvDelete an environment variable.
printenvDisplay the environment variables
setenv  Set an environment variable.
helpObtain help for CFE commands

For more information about a command, enter 'help command-name'
*** command status = 0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Un-softbricking Linksys E900 (bcm47xx) with CFE

2013-09-09 Thread Rafał Miłecki
2013/9/9 Rafał Miłecki zaj...@gmail.com:
 1) flash [options] source-file [destination-file]
 Passing source-file is easy (like 192.168.1.2:/bin/code.bin), but I'm
 not sure about destination-file.

 The destination-device parameter may be a flash device or an EEPROM. If not 
 specified, destination-device defaults to flash0, which is typically the 
 boot ROM.

 If I don't pass anything as destination-file argument... Is CFE going
 to write to the flash at offset 0x0? Overwriting itself? Or is it
 going to write to the correct TRX offset? If it's going to use 0x0 by
 default, should I pass -offset=value to avoid killing the CFE?

I think I could use flash0.trx as a destination-file instead of
using flash0 and hacking it with -offset.

What do you think about this:
flash -noheader 192.168.1.2:openwrt-brcm47xx-squashfs.trx flash0.trx

(Please see attached cfe.show.devices.txt).

-- 
Rafał
CFE show devices
CMD: [show devices]
Device Name  Description
---  -
uart0NS16550 UART at 0x18000300
flash0.boot  ST Serial flash offset  size 256KB
flash0.trx   ST Serial flash offset 0004 size 1KB
flash0.osST Serial flash offset 0004001C size 7872KB
flash0.nvram ST Serial flash offset 007F size 64KB
flash1.boot  ST Serial flash offset  size 256KB
flash1.trx   ST Serial flash offset 0004 size 7872KB
flash1.nvram ST Serial flash offset 007F size 64KB
flash0   ST Serial flash size 8192KB
eth0 Broadcom BCM47XX 10/100/1000 Mbps Ethernet Controller
*** command status = 0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] ath9k (ad-hoc?) problems in compat-wireless trunk as of sept 6/2

2013-09-09 Thread Nicolás Echániz
I have kept testing this and was able to reproduce the same problem
every time.
The performance perception when the network is at rush hour is very
unstable so I tried to reproduce traffic conditions during late night.
I sent multiple netperfs through different routes and while the netperfs
were running turned of one node. Latency climbed to the thousands and it
took a while for it to stabilize again.

Then I turned off another node, latency went sky high again for some
seconds until I lost conectivity and could monitor no more.

I waited more than 15 minutes for the net to be reachable again from my
local node. (Nodes are automatically reset when they cannot reach the
network gateway for more than 15 minutes)

All ping tests are done on fe80 local IPv6 addresses so no routing
protocol is involved in case someone's wondering. Also, from what I see
(iw station dump), routers are associated but can send no data.

After 15 minutes of waiting, this is what station dump was showing from
my local node:
root@nogal:~# iw wlan0 station dump
Station 64:70:02:3d:85:0a (on wlan0)
inactive time:  40 ms
rx bytes:   175693
rx packets: 2642
tx bytes:   0
tx packets: 0
tx retries: 0
tx failed:  0
signal: -69 dBm
signal avg: -65 dBm
tx bitrate: 1.0 MBit/s
rx bitrate: 1.0 MBit/s
authorized: yes
authenticated:  yes
preamble:   long
WMM/WME:yes
MFP:no


station dump shows no tx data at all...

and of course no ping

root@nogal:~# ping6 fe80::6670:2ff:fe3d:850a%wlan0
PING fe80::6670:2ff:fe3d:850a%wlan0(fe80::6670:2ff:fe3d:850a) 56 data bytes
From fe80::92f6:52ff:febb:ec58 icmp_seq=1 Destination unreachable:
Address unreachable
From fe80::92f6:52ff:febb:ec58 icmp_seq=2 Destination unreachable:
Address unreachable



I'll try to keep this nodes on this version to help debug, but the
network is in production, so I can't do this for long without getting
complaints :)

Cheers.

Nico.


El 07/09/13 22:40, Nicolás Echániz escribió:
 
 We are testing current wireless in QuintanaLibre and we are finding some 
 strange behaviors.
 
 The first symptom we have been able to reproduce is this:
 
 Given nodes A and B which are neighbors with a good link quality (-68 signal, 
 15Mbps throughput) and a third node C which has a comparable link to A and a 
 low signal link to B. When we turn of C's wireless the latency between node A 
 and B will be extremely high (in the thousands of ms) for almost one minute.
 
 In this example, nodes A and B are marisa and nogal. And node C is gerylu 
 (which we turn off 200 sec after the ping starts).
 
 http://pastebin.com/MzWSCDRb
 
 
 the moment when the ping times return to normal is coincidential with the iw 
 event (as seen from marisa -Node A- ):
 
 wlan0 (phy #0): connection quality monitor event: peer 92:f6:52:c6:00:ed 
 didn't ACK 50 packets
 wlan0: del station 92:f6:52:c6:00:ed
 
 92:f6:52:c6:00:ed   -- this is gerylu (node C)
 
 
 We are observing an overall instability in the network which consists of 40 
 nodes (100% ad-hoc) some of which hear up to 16 neighbors in the iw station 
 dump, so this scenario may be occurring frequently.
 
 Lastly, we also observe that some nodes are not associating on one of their 
 interfaces (they are dual band), although they did associate correctly before 
 the upgrade.
 
 
 
 We will keep some nodes with this version for a couple of days in case 
 someone (Felix?) want's to log in and do some live testing.
 
 Guido will add some more info from the tcpdumps we collected if it's relevant.
 
 
 Cheers,
 Nico
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Un-softbricking Linksys E900 (bcm47xx) with CFE

2013-09-09 Thread Hauke Mehrtens
On 09/09/2013 12:52 PM, Rafał Miłecki wrote:
 2013/9/9 Rafał Miłecki zaj...@gmail.com:
 1) flash [options] source-file [destination-file]
 Passing source-file is easy (like 192.168.1.2:/bin/code.bin), but I'm
 not sure about destination-file.

 The destination-device parameter may be a flash device or an EEPROM. If not 
 specified, destination-device defaults to flash0, which is typically the 
 boot ROM.

 If I don't pass anything as destination-file argument... Is CFE going
 to write to the flash at offset 0x0? Overwriting itself? Or is it
 going to write to the correct TRX offset? If it's going to use 0x0 by
 default, should I pass -offset=value to avoid killing the CFE?
 
 I think I could use flash0.trx as a destination-file instead of
 using flash0 and hacking it with -offset.
 
 What do you think about this:
 flash -noheader 192.168.1.2:openwrt-brcm47xx-squashfs.trx flash0.trx
 
 (Please see attached cfe.show.devices.txt).
 
I used something similar to flash my WNDR3400 after I accidentally
removed the board_data partition and the normal flashing did not work
any more, I do ot have access to my documentation currently,

This out of memory problem could also be that the wrong compression was
used.
CMD: [boot -raw -z -addr=0x80001000 -max=0x1851e50 -fs=memory :0x807ae1b0]
This looks like it expect gzip compressed data.

Is there any page with a small documentation of CFE, I just know of a
PDF from Broadcom? Most of my devices do not have this help command, it
would be nice to have some of these informations in the wiki.

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


Re: [OpenWrt-Devel] Un-softbricking Linksys E900 (bcm47xx) with CFE

2013-09-09 Thread Rafał Miłecki
2013/9/9 Hauke Mehrtens ha...@hauke-m.de:
 On 09/09/2013 12:52 PM, Rafał Miłecki wrote:
 2013/9/9 Rafał Miłecki zaj...@gmail.com:
 1) flash [options] source-file [destination-file]
 Passing source-file is easy (like 192.168.1.2:/bin/code.bin), but I'm
 not sure about destination-file.

 The destination-device parameter may be a flash device or an EEPROM. If 
 not specified, destination-device defaults to flash0, which is typically 
 the boot ROM.

 If I don't pass anything as destination-file argument... Is CFE going
 to write to the flash at offset 0x0? Overwriting itself? Or is it
 going to write to the correct TRX offset? If it's going to use 0x0 by
 default, should I pass -offset=value to avoid killing the CFE?

 I think I could use flash0.trx as a destination-file instead of
 using flash0 and hacking it with -offset.

 What do you think about this:
 flash -noheader 192.168.1.2:openwrt-brcm47xx-squashfs.trx flash0.trx

 (Please see attached cfe.show.devices.txt).

 I used something similar to flash my WNDR3400 after I accidentally
 removed the board_data partition and the normal flashing did not work
 any more, I do ot have access to my documentation currently,

 This out of memory problem could also be that the wrong compression was
 used.
 CMD: [boot -raw -z -addr=0x80001000 -max=0x1851e50 -fs=memory :0x807ae1b0]
 This looks like it expect gzip compressed data.

Well, I was uploading original firmware, so there couldn't be much
wrong. Unless it's CFE that doesn't like original router firmware.

In that situation I decided to give flash command a try (as planned
earlier). It didn't work. Image was transferred, but CFE never started
writing it to the flash :(

CFE flash -ctheader 192.168.1.2:/code.bin flash0.trx
CMD: [flash -ctheader 192.168.1.2:/code.bin flash0.trx]
Reading 192.168.1.2:/code.bin: _tftp_open(): retries=0/3
Done. 5161984 bytes read, fname=(null)
[NO PROMPT, REBOOT WAS NEEDED]

CFE flash -ctheader 192.168.1.2:/E900_v1.0.04.001_US_20120816.bin flash0.trx
CMD: [flash -ctheader 192.168.1.2:/E900_v1.0.04.001_US_20120816.bin flash0.trx]
Reading 192.168.1.2:/E900_v1.0.04.001_US_20120816.bin: _tftp_open(): retries=0/3
Done. 7123968 bytes read, fname=(null
[NO PROMPT, REBOOT WAS NEEDED]

But then I found another way of installing firmware. I called flash
command without pointing remote host of file. In that combination CFE
decided to setup tftp server and wait for the firmware (just like in
case of running tftpd in other CFEs, Netgear for example):

CFE flash -ctheader : flash0.trx
CMD: [flash -ctheader : flash0.trx]
Reading :: _tftpd_open(): retries=0/3
Done. 5157888 bytes read, fname=flash1.trx
CODE Pattern is correct! (E900)

TRX flash_size: 8388608, len: 5156864
it's code.bin

TRX file size = 5156864
Burning code image.
Programming...done. 5156864 bytes written
*** command status = 0

Hooray! After that I just had to type reboot. Of course, on my
machine I had to run:
tftp 192.168.1.1 -m binary -c put code.bin


 Is there any page with a small documentation of CFE, I just know of a
 PDF from Broadcom? Most of my devices do not have this help command, it
 would be nice to have some of these informations in the wiki.

I know of http://melbourne.wireless.org.au/files/wrt54/cfe.pdf only.

It would be nice to document all that command and know issues.

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


[OpenWrt-Devel] [PATCH] This upgrades haveged from 1.4 to 1.7c (closes #13979)

2013-09-09 Thread Christian Pointner

Signed-off-by: Christian Pointner equi...@chaos-at-home.org
---
 utils/haveged/Makefile   | 40 +---
 utils/haveged/files/haveged.init |  4 ++--
 2 files changed, 35 insertions(+), 9 deletions(-)

diff --git a/utils/haveged/Makefile b/utils/haveged/Makefile
index d176f40..05fbbe5 100644
--- a/utils/haveged/Makefile
+++ b/utils/haveged/Makefile
@@ -4,17 +4,17 @@
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
-# $Id: Makefile 1 2012-01-12 03:50:18Z Olipro $ 
+# $Id: Makefile 1 2012-01-12 03:50:18Z Olipro $
 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=haveged
-PKG_VERSION:=1.5
+PKG_VERSION:=1.7c
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.issihosts.com/$(PKG_NAME)
-PKG_MD5SUM:=c1f34be00c3f438ec83862e90e192e4b
+PKG_MD5SUM:=036760389b1827a2532e248dd3cc46d3
 
 #ensure this is consistent with the dir in the tarball!!!
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
@@ -23,19 +23,45 @@ PKG_BUILD_PARALLEL:=1
 
 include $(INCLUDE_DIR)/package.mk
 
-define Package/haveged
+define Package/haveged/template
   SECTION:=utils
   CATEGORY:=Utilities
   TITLE:=Feeds the kernel entropy pool by timing CPU loops.
-  DEPENDS:=+librt +libpthread
   URL:=http://www.issihosts.com/haveged/
 endef
 
+define Package/haveged
+  $(call Package/haveged/template)
+  DEPENDS:=+libhavege
+endef
+
+define Package/libhavege
+  $(call Package/haveged/template)
+  TITLE:=Library for haveged
+endef
+
+CONFIGURE_ARGS+= \
+  --enable-daemon=yes
+  --enable-threads=no
+
+define Build/InstallDev
+   $(INSTALL_DIR) $(1)/usr/include
+   $(CP) $(PKG_BUILD_DIR)/src/havege.h $(1)/usr/include/
+   $(INSTALL_DIR) $(1)/usr/lib
+   $(CP) $(PKG_BUILD_DIR)/src/.libs/libhavege.{a,so*} $(1)/usr/lib/
+endef
+
 define Package/haveged/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/haveged.init $(1)/etc/init.d/haveged
-   $(INSTALL_DIR) $(1)/sbin
-   $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/haveged $(1)/sbin/
+   $(INSTALL_DIR) $(1)/usr/sbin
+   $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/.libs/haveged $(1)/usr/sbin/
+endef
+
+define Package/libhavege/install
+   $(INSTALL_DIR) $(1)/usr/lib
+   $(CP) $(PKG_BUILD_DIR)/src/.libs/libhavege.so* $(1)/usr/lib/
 endef
 
 $(eval $(call BuildPackage,haveged))
+$(eval $(call BuildPackage,libhavege))
diff --git a/utils/haveged/files/haveged.init b/utils/haveged/files/haveged.init
index 129d951..ce28e61 100644
--- a/utils/haveged/files/haveged.init
+++ b/utils/haveged/files/haveged.init
@@ -8,9 +8,9 @@ HAVEGED_DCACHE=32
 HAVEGED_ICACHE=32
 
 start() {
-   service_start /sbin/haveged -w $HAVEGED_THRESHOLD -d $HAVEGED_DCACHE -i 
$HAVEGED_ICACHE -v 1
+   service_start /usr/sbin/haveged -w $HAVEGED_THRESHOLD -d 
$HAVEGED_DCACHE -i $HAVEGED_ICACHE -v 1
 }
 
 stop() {
-   service_stop /sbin/haveged
+   service_stop /usr/sbin/haveged
 }
-- 
1.8.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 001/001] [brcm47xx] board detection, GPIO for Linksys E1000 V2.1

2013-09-09 Thread Zachary Catlin
From: Zachary Catlin zcat...@indiana.edu

This patch adds board detection for the Linksys E1000 V2.1 router, as well
as GPIO support for same.

Signed-off-by: Zachary Catlin zcat...@indiana.edu
---
NOTE: This is identical to the patch I sent earlier today (local time),
but the first time around my mail client messed up spaces in the diff.
Trying again with a different client.

This fixes bug #14135. Currently, wired networking isn't working on the
router, and I haven't tried the wireless, but with this patch, OpenWRT
successfully boots, and all the LEDs and buttons work properly.
===
--- 
target/linux/brcm47xx/patches-3.10/260-MIPS-BCM47XX-add-board-detection.patch   
(revision 37919)
+++ 
target/linux/brcm47xx/patches-3.10/260-MIPS-BCM47XX-add-board-detection.patch   
(working copy)
@@ -8,7 +8,7 @@
  obj-$(CONFIG_BCM47XX_SSB) += wgt634u.o
 --- /dev/null
 +++ b/arch/mips/bcm47xx/board.c
-@@ -0,0 +1,240 @@
+@@ -0,0 +1,241 @@
 +#include linux/export.h
 +#include linux/string.h
 +#include bcm47xx_board.h
@@ -101,6 +101,7 @@
 +  {{BCM47XX_BOARD_CISCO_M20V1, Cisco M20}, M20, 1.0}, /* like 
WRT310N v2.0 */
 +  {{BCM47XX_BOARD_LINKSYS_E1000V1, Linksys E1000 V1}, E100, 1.0},  
/* like WRT160N v3.0 */
 +  {{BCM47XX_BOARD_LINKSYS_E1000V2, Linksys E1000 V2}, E1000, 2.0},
++  {{BCM47XX_BOARD_LINKSYS_E1000V21, Linksys E1000 V2.1}, E1000, 
2.1},
 +  {{BCM47XX_BOARD_LINKSYS_E2000V1, Linksys E2000 V1}, Linksys E2000, 
1.0},
 +  {{BCM47XX_BOARD_LINKSYS_E3000V1, Linksys E3000 V1}, E300, 1.0}, 
/* like WRT610N v2.0 */
 +  {{BCM47XX_BOARD_LINKSYS_E3200V1, Linksys E3200 V1}, E3200, 1.0},
@@ -251,7 +252,7 @@
 +EXPORT_SYMBOL(bcm47xx_board_get_name);
 --- /dev/null
 +++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
-@@ -0,0 +1,97 @@
+@@ -0,0 +1,98 @@
 +#ifndef __BCM47XX_BOARD_H
 +#define __BCM47XX_BOARD_H
 +
@@ -302,6 +303,7 @@
 +
 +  BCM47XX_BOARD_LINKSYS_E1000V1,
 +  BCM47XX_BOARD_LINKSYS_E1000V2,
++  BCM47XX_BOARD_LINKSYS_E1000V21,
 +  BCM47XX_BOARD_LINKSYS_E2000V1,
 +  BCM47XX_BOARD_LINKSYS_E3000V1,
 +  BCM47XX_BOARD_LINKSYS_E3200V1,
Index: package/kernel/broadcom-diag/src/diag.c
===
--- package/kernel/broadcom-diag/src/diag.c (revision 37919)
+++ package/kernel/broadcom-diag/src/diag.c (working copy)
@@ -89,6 +89,7 @@
WRT610N,
WRT610NV2,
E1000V1,
+   E1000V21,
E3000V1,
E3200V1,
E4200V1,
@@ -471,6 +472,19 @@
{ .name = ses_orange, .gpio = 1  2, .polarity = 
REVERSE }, /* nvram get gpio2=wps_status_led */
},
},
+   [E1000V21] = {
+   .name   = Linksys E1000 V2.1,
+   .buttons= {
+   { .name = reset,  .gpio = 1  10 }, /* nvram get 
reset_gpio=10 */
+   { .name = wps,.gpio = 1  9 }, /* nvram get 
gpio9=wps_button */
+   },
+   .leds   = {
+   { .name = power,  .gpio = 1  6, .polarity = 
REVERSE },
+   { .name = wlan,   .gpio = 1  5, .polarity = 
NORMAL },
+   { .name = ses_blue,   .gpio = 1  8, .polarity = 
NORMAL }, /* nvram get gpio8=wps_led */
+   { .name = ses_orange, .gpio = 1  7, .polarity = 
NORMAL }, /* nvram get gpio7=wps_status_led */
+   },
+   },
[E3000V1] = {
.name   = Linksys E3000 V1,
.buttons= {
@@ -1349,6 +1363,8 @@
return platforms[DIR330];
case BCM47XX_BOARD_LINKSYS_E1000V1:
return platforms[E1000V1];
+   case BCM47XX_BOARD_LINKSYS_E1000V21:
+   return platforms[E1000V21];
case BCM47XX_BOARD_LINKSYS_E3000V1:
return platforms[E3000V1];
case BCM47XX_BOARD_LINKSYS_E3200V1:
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] packages: enable ip on busybox

2013-09-09 Thread Luis R. Rodriguez
On Fri, Sep 6, 2013 at 12:39 PM, Luis R. Rodriguez
mcg...@qca.qualcomm.com wrote:
 From: Luis R. Rodriguez mcg...@qca.qualcomm.com

 iw is to iwconfig as
 ip is to ifconfig

 As with iwconfig, ifconfig is deprecated, promote usage of ip
 using netlink.

 Signed-off-by: Luis R. Rodriguez mcg...@qca.qualcomm.com

Actually perhaps its best to enable iproute2 package instead.

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


[OpenWrt-Devel] [PATCH 0/7] hostapd: series of hostapd fixes

2013-09-09 Thread Luis R. Rodriguez
From: Luis R. Rodriguez mcg...@qca.qualcomm.com

Here's a series of hostapd fixes that have helped pass
both 802.11n and WPS testings.

Luis R. Rodriguez (1):
  hostapd: fix hostapd RSN preauthentication PMKSA caching

Mathieu Olivari (5):
  hostapd: Add eap_reauth_period config option
  hostapd: Add WPS unconfigured  WPS pin method support
  hostapd: prompt user confirmation when WPS is used with hiden ssid
  hostapd: add external registrar support
  hostapd: recognize 8021x as an authentication mode

Sujith Manoharan (1):
  hostapd: enable WPS2 support on hostapd-full.config

 .../services/hostapd/files/hostapd-full.config |3 +-
 package/network/services/hostapd/files/hostapd.sh  |   59 +---
 2 files changed, 53 insertions(+), 9 deletions(-)

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


[OpenWrt-Devel] [PATCH 3/7] hostapd: fix hostapd RSN preauthentication PMKSA caching

2013-09-09 Thread Luis R. Rodriguez
From: Luis R. Rodriguez mcg...@do-not-panic.com

In 2009 OpenWrt's hostapd config added an auth_cache boolean
to be used to address a reported issue #12129 [0] on a forum [1].
The reported issue on the ticket is different that the one
described on the forum. The commit was r33359. This change broke
proper RSN preauthentication [2] [3] [4] expectations on hostapd's
configuration for WPA2 and this in turn disabled PMKSA caching and
Opportunistic Key Caching. This change:

  * Leaves the auth_cache to be used only for WPA networks for those
looking to use this as a workaround to a reported issue but annotates
a warning over its usage.

  * Separate auth_cache from WPA2 RSN preauthentication, leaving
WPA2 RSN preauthentication to enabled only with rsn_preauth with
the expected and recommended settings.

  * Adds a new WPA2 RSN preauthentication rsn_preauth_testing to
be used when evaluating funcionality for WPA2 RSN preauthentication
with the expected and recommended settings with the only difference
so far with what should be enabled by default to disable Opportunistic
Key Caching.

Disabling the PMKSA cache should mean the STA could not roam off and back
onto the AP that had PMKSA caching disabled and would require a full
authentication cycle. This fixes this for WPA2 networks with
RSN preauthentication enabled.

This change should be applied to AA as well as trunk.

  TL DR;

The issue described on the forum has to do with failure of a STA
being able to try to authenticate again with the AP if it failed
its first try. This may have been an issue with hostapd in 2009
but as per some tests I cannot reproduce this today on a WPA2
network.

The issue described on the ticket alludes to a security issue with the
design of using a Radius server to authenticate to an AP. The issue
vaguely alludes to the circumstances of zapping a user, deleting their
authentication credentials to log in to the network, and that if
RSN preauthentication is enabled with PMKSA caching that the user
that was zapped would still be able to authenticate.

Lets treat these as separate issues.

I cannot reproduce the first issue reported on the forums of not
being able to authenticate anymore on a WPA2 network.

The issue reported on the ticket modified WPA2 RSN preauthentication
by adding two fields to the hostapd configuration if auth_cache
was enabled:

  * disable_pmksa_caching=1
  * okc=0

The first one disables PMKSA authentication cache.
The second one disables Opportunistic Key Caching.

The issue reported on the ticket was fixed by implementing a workaround
in hostapd's configuration. Disabling PMKSA caching breaks proper use
of WPA2 RSN pre authentication. The usage of disable_pmksa_caching=1
prevents hostapd from adding PMKSA entries into its cache when a successful
802.1x authentication occurs. In practice RSN preauthentication would
trigger a STA to perform authentication with other APs on the same SSID,
it would then have its own supplicant PMKSA cache held. If a STA roams
between one AP to another no new authenitcation would need to be performed
as the new AP would already have authenticated the STA. The purpose of the
PMKSA cache on the AP side would be for the AP to use the same PMKID for
a STA when the STA roams off onto another BSSID and later comes back to it.

Disabling Opportunistic Key Caching could help the reported issue
as well but its not the correct place to address this. Opportunistic
Key Caching enables an AP with different interfaces to share the
PMKSA cache. Its a technical enhancement and disabling it would
be useful to let a testing suite properly test for RSN preauthentication
given that otherwise Opportunistic Key Caching would enable an
interface being tested to derive its own derive the PMKSA entry.
In production though okc=1 should be enabled to help with RSN
preauthentication.

The real fix for this particular issue outside of the scope of hostapd's
configuration and it should not be dealt with as a workaround to
its configuration and breaking expected RSN preauthentication and
technical optimizations. Revert this change and enable users to pick
and choose to enable or disable disable_pmksa_caching and okc expecting them
to instead have read clearly more what these do.

As for the core issure ported, the correct place to fix this is to
enable a sort of messaging between the RADIUS server and its peers
so that if caching for authentication is enabled that cache can be
cleared upon user credential updates. Updating a user password
(not just zapping a user) is another possible issue that would need
to be resolved here. Another part of the solution might be to reduce
the cache timing to account for any systematic limitations (RADIUS
server not able to ask peers to clear cache might be
one).

[0] https://dev.openwrt.org/changeset/33359
[1] https://forum.openwrt.org/viewtopic.php?id=19596
[2] 

[OpenWrt-Devel] [PATCH 2/7] hostapd: Add WPS unconfigured WPS pin method support

2013-09-09 Thread Luis R. Rodriguez
From: Mathieu Olivari math...@qca.qualcomm.com

Signed-off-by: Mathieu Olivari math...@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez mcg...@qca.qualcomm.com
---
 package/network/services/hostapd/files/hostapd.sh |   16 +---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/package/network/services/hostapd/files/hostapd.sh 
b/package/network/services/hostapd/files/hostapd.sh
index 0f1a619..aace21c 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -3,7 +3,7 @@ hostapd_set_bss_options() {
local vif=$2
local enc wep_rekey wpa_group_rekey wpa_pair_rekey wpa_master_rekey 
wps_possible
 
-   config_get enc $vif encryption
+   config_get enc $vif encryption none
config_get wep_rekey$vif wep_rekey# 300
config_get wpa_group_rekey  $vif wpa_group_rekey  # 300
config_get wpa_pair_rekey   $vif wpa_pair_rekey   # 300
@@ -73,6 +73,14 @@ hostapd_set_bss_options() {
 
# use crypto/auth settings for building the hostapd config
case $enc in
+   none)
+   wps_possible=1
+   wpa=0
+   crypto=
+   # Here we make the assumption that if we're in open mode
+   # with WPS enabled, we got to be in unconfigured state.
+   wps_not_configured=1
+   ;;
*psk*)
config_get psk $vif key
if [ ${#psk} -eq 64 ]; then
@@ -182,10 +190,12 @@ hostapd_set_bss_options() {
config_get device_type $vif wps_device_type 6-0050F204-1
config_get device_name $vif wps_device_name OpenWrt AP
config_get manufacturer $vif wps_manufacturer openwrt.org
+   config_get wps_pin $vif wps_pin 12345670
 
append $var eap_server=1 $N
-   append $var wps_state=2 $N
-   append $var ap_setup_locked=1 $N
+   append $var ap_pin=$wps_pin $N
+   append $var wps_state=${wps_not_configured:-2} $N
+   append $var ap_setup_locked=0 $N
append $var device_type=$device_type $N
append $var device_name=$device_name $N
append $var manufacturer=$manufacturer $N
-- 
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/7] hostapd: Add eap_reauth_period config option

2013-09-09 Thread Luis R. Rodriguez
From: Mathieu Olivari math...@qca.qualcomm.com

This adds the eap_reauth_period to be used for modifying
the RADIUS server reauthentication authentication period,
a parameter that gets passed directly to the hostapd
configuration file.

Signed-off-by: Mathieu Olivari math...@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez mcg...@qca.qualcomm.com
---
 package/network/services/hostapd/files/hostapd.sh |2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/network/services/hostapd/files/hostapd.sh 
b/package/network/services/hostapd/files/hostapd.sh
index e25e870..0f1a619 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -108,6 +108,8 @@ hostapd_set_bss_options() {
[ -n $acct_port ]  append $var 
acct_server_port=$acct_port $N
config_get acct_secret $vif acct_secret
[ -n $acct_secret ]  append $var 
acct_server_shared_secret=$acct_secret $N
+   config_get eap_reauth_period $vif eap_reauth_period
+   [ -n $eap_reauth_period ]  append $var 
eap_reauth_period=$eap_reauth_period $N
config_get dae_client $vif dae_client
config_get dae_secret $vif dae_secret
[ -n $dae_client -a -n $dae_secret ]  {
-- 
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 4/7] hostapd: enable WPS2 support on hostapd-full.config

2013-09-09 Thread Luis R. Rodriguez
From: Sujith Manoharan c_man...@qca.qualcomm.com

Enable CONFIG_WPS2 for hostapd. This is required to support
options like Virtual Push Button in WPS.

Signed-off-by: Sujith Manoharan c_man...@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez mcg...@qca.qualcomm.com
---
 package/network/services/hostapd/files/hostapd-full.config |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/network/services/hostapd/files/hostapd-full.config 
b/package/network/services/hostapd/files/hostapd-full.config
index c88fedd..ae0c7cc 100644
--- a/package/network/services/hostapd/files/hostapd-full.config
+++ b/package/network/services/hostapd/files/hostapd-full.config
@@ -107,7 +107,8 @@ CONFIG_EAP_TTLS=y
 #CONFIG_EAP_FAST=y
 
 # Wi-Fi Protected Setup (WPS)
-#CONFIG_WPS=y
+CONFIG_WPS=y
+CONFIG_WPS2=y
 # Enable UPnP support for external WPS Registrars
 #CONFIG_WPS_UPNP=y
 
-- 
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 5/7] hostapd: prompt user confirmation when WPS is used with hiden ssid

2013-09-09 Thread Luis R. Rodriguez
From: Mathieu Olivari math...@qca.qualcomm.com

This is required explicitly for WPS 2.0 testing.

Signed-off-by: Mathieu Olivari math...@qca.qualcomm.com
Signed-off-by: Sujith Manoharan c_man...@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez mcg...@qca.qualcomm.com
---
 package/network/services/hostapd/files/hostapd.sh |   11 +++
 1 file changed, 11 insertions(+)

diff --git a/package/network/services/hostapd/files/hostapd.sh 
b/package/network/services/hostapd/files/hostapd.sh
index ce0f227..56e6eb0 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -190,6 +190,17 @@ hostapd_set_bss_options() {
config_get config_methods $vif wps_config
[ $wps_pbc -gt 0 ]  append config_methods push_button
 
+   # For WPS 2.0 testing, the testing requires this as a feature.
+   # If we're configured to enable WPS and we hide our SSID, then
+   # we have to require an explicit user operation to continue
+   config_get_bool hidden $vif hidden 0
+   [ -n $wps_possible -a -n $config_methods -a $hidden -gt 0 ]  {
+   echo Hidden SSID is enabled on \$ifname\, WPS will be 
automatically disabled
+   echo Please press any key to continue.
+   read -s -n 1
+   wps_possible=
+   }
+
[ -n $wps_possible -a -n $config_methods ]  {
config_get device_type $vif wps_device_type 6-0050F204-1
config_get device_name $vif wps_device_name OpenWrt AP
-- 
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 6/7] hostapd: add external registrar support

2013-09-09 Thread Luis R. Rodriguez
From: Mathieu Olivari math...@qca.qualcomm.com

Setting wireless.@wifi-iface[N].ext_registrar=1 will enable UPNP
advertising and add an external registrar to the interface this vif
belongs to (br-lan if the vif is included in the LAN bridge). By
enabling this we append upnp_iface=xxx to the hostapd config file.

Signed-off-by: Sujith Manoharan c_man...@qca.qualcomm.com
Signed-off-by: Mathieu Olivari math...@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez mcg...@qca.qualcomm.com
---
 package/network/services/hostapd/files/hostapd.sh |3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/network/services/hostapd/files/hostapd.sh 
b/package/network/services/hostapd/files/hostapd.sh
index 56e6eb0..8e51fe7 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -207,6 +207,9 @@ hostapd_set_bss_options() {
config_get manufacturer $vif wps_manufacturer openwrt.org
config_get wps_pin $vif wps_pin 12345670
 
+   config_get_bool ext_registrar $vif ext_registrar 0
+   [ $ext_registrar -gt 0 -a -n $bridge ]  append $var 
upnp_iface=$bridge $N
+
append $var eap_server=1 $N
append $var ap_pin=$wps_pin $N
append $var wps_state=${wps_not_configured:-2} $N
-- 
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 7/7] hostapd: recognize 8021x as an authentication mode

2013-09-09 Thread Luis R. Rodriguez
From: Mathieu Olivari math...@qca.qualcomm.com

Currently, in order to configure the authentication daemon in
8021x mode, we need to set wireless.@wifi-iface[0].encryption=wpa
Though it works it confuses folks as 8021x is using WEP
encryption and not WPA. Therefore the terminology itself is
confusing. This change adds 8021x as a recognized string for 8021x
authentication.

Signed-off-by: Mathieu Olivari math...@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez mcg...@qca.qualcomm.com
---
 package/network/services/hostapd/files/hostapd.sh |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/network/services/hostapd/files/hostapd.sh 
b/package/network/services/hostapd/files/hostapd.sh
index 8e51fe7..1cd4283 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -93,7 +93,7 @@ hostapd_set_bss_options() {
[ -n $wpa_pair_rekey   ]  append $var 
wpa_ptk_rekey=$wpa_pair_rekey$N
[ -n $wpa_master_rekey ]  append $var 
wpa_gmk_rekey=$wpa_master_rekey  $N
;;
-   *wpa*)
+   *wpa*|*8021x*)
# required fields? formats?
# hostapd is particular, maybe a default configuration 
for failures
config_get auth_server $vif auth_server
-- 
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Un-softbricking Linksys E900 (bcm47xx) with CFE

2013-09-09 Thread Nathan Hintz
On Mon, 9 Sep 2013 16:06:49 +0200
Rafał Miłecki zaj...@gmail.com wrote:

 2013/9/9 Hauke Mehrtens ha...@hauke-m.de:
  On 09/09/2013 12:52 PM, Rafał Miłecki wrote:
  2013/9/9 Rafał Miłecki zaj...@gmail.com:
  1) flash [options] source-file [destination-file]
  Passing source-file is easy (like 192.168.1.2:/bin/code.bin), but
  I'm not sure about destination-file.
 
  The destination-device parameter may be a flash device or an
  EEPROM. If not specified, destination-device defaults to flash0,
  which is typically the boot ROM.
 
  If I don't pass anything as destination-file argument... Is CFE
  going to write to the flash at offset 0x0? Overwriting itself? Or
  is it going to write to the correct TRX offset? If it's going to
  use 0x0 by default, should I pass -offset=value to avoid killing
  the CFE?
 
  I think I could use flash0.trx as a destination-file instead of
  using flash0 and hacking it with -offset.
 
  What do you think about this:
  flash -noheader 192.168.1.2:openwrt-brcm47xx-squashfs.trx
  flash0.trx
 
  (Please see attached cfe.show.devices.txt).
 
  I used something similar to flash my WNDR3400 after I accidentally
  removed the board_data partition and the normal flashing did not
  work any more, I do ot have access to my documentation currently,
 
  This out of memory problem could also be that the wrong compression
  was used.
  CMD: [boot -raw -z -addr=0x80001000 -max=0x1851e50
  -fs=memory :0x807ae1b0] This looks like it expect gzip compressed
  data.
 
 Well, I was uploading original firmware, so there couldn't be much
 wrong. Unless it's CFE that doesn't like original router firmware.
 
 In that situation I decided to give flash command a try (as planned
 earlier). It didn't work. Image was transferred, but CFE never started
 writing it to the flash :(
 
 CFE flash -ctheader 192.168.1.2:/code.bin flash0.trx
 CMD: [flash -ctheader 192.168.1.2:/code.bin flash0.trx]
 Reading 192.168.1.2:/code.bin: _tftp_open(): retries=0/3
 Done. 5161984 bytes read, fname=(null)
 [NO PROMPT, REBOOT WAS NEEDED]
 
 CFE flash -ctheader 192.168.1.2:/E900_v1.0.04.001_US_20120816.bin
 CFE flash0.trx
 CMD: [flash -ctheader 192.168.1.2:/E900_v1.0.04.001_US_20120816.bin
 flash0.trx] Reading 192.168.1.2:/E900_v1.0.04.001_US_20120816.bin:
 _tftp_open(): retries=0/3 Done. 7123968 bytes read, fname=(null
 [NO PROMPT, REBOOT WAS NEEDED]
 
 But then I found another way of installing firmware. I called flash
 command without pointing remote host of file. In that combination CFE
 decided to setup tftp server and wait for the firmware (just like in
 case of running tftpd in other CFEs, Netgear for example):
 
 CFE flash -ctheader : flash0.trx
 CMD: [flash -ctheader : flash0.trx]
 Reading :: _tftpd_open(): retries=0/3
 Done. 5157888 bytes read, fname=flash1.trx
 CODE Pattern is correct! (E900)
 
 TRX flash_size: 8388608, len: 5156864
 it's code.bin
 
 TRX file size = 5156864
 Burning code image.
 Programming...done. 5156864 bytes written
 *** command status = 0
 
 Hooray! After that I just had to type reboot. Of course, on my
 machine I had to run:
 tftp 192.168.1.1 -m binary -c put code.bin
 
 
  Is there any page with a small documentation of CFE, I just know of
  a PDF from Broadcom? Most of my devices do not have this help
  command, it would be nice to have some of these informations in the
  wiki.
 
 I know of http://melbourne.wireless.org.au/files/wrt54/cfe.pdf only.
 
 It would be nice to document all that command and know issues.
 

On Linksys E3000, I've always used the CFE command upgrade code.bin; and
then tftp'd from my linux box using the command
tftp -v -l -4 -m binary 192.168.1.1 -c put openwrt-e3000_v1-squashfs.bin.
I found this through experimentation; and never stumbled upon the right
combination using the flash command.
 
Nathan
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel