Re: [OpenWrt-Devel] question about ath9k endianness check in eeprom_9287.c

2015-01-16 Thread Ben Mulvihill
On Sun, 2014-12-28 at 01:02 +0100, Ben Mulvihill wrote:
 Hello Felix,
 
 I am working on the BT Home Hub 3A, which has ath9k wireless.
 More or less everything is working now, apart from
 reading the calibration data. To get that working too, 
 endianness checking must be enabled. That requires a one line
 fix to eeprom_9257.c . 
 
 --- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c2014-09-27 
 15:48:08.0 +0200
 +++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c2014-12-28 
 00:55:52.0 +0100
 @@ -184,7 +184,7 @@ static int ath9k_hw_ar9287_check_eeprom(
   struct ar9287_eeprom *eep = ah-eeprom.map9287;
   struct ath_common *common = ath9k_hw_common(ah);
  
 - if (!ath9k_hw_use_flash(ah)) {
 + if (!(ah-ah_flags  AH_NO_EEP_SWAP)) {
   if (!ath9k_hw_nvram_read(ah, AR5416_EEPROM_MAGIC_OFFSET,
magic)) {
   ath_err(common, Reading Magic # failed\n);
 
 A similar fix was in fact present until quite recently
 (till r42950 to be precise) in
 package/kernel/mac80211/patches/501-ath9k-eeprom_endianess.patch
 but in the wrong place (there are two calls to ath9k_hw_use_flash()
 in eeprom_9287.c, and the patch changed the wrong one). With
 changeset 42951 that fix was then dropped (together with the
 equivalent fix to eeprom_4k.c).
 
 A much much earlier version of 501-ath9k-eeprom_endianess.patch
 (r31084) contains the fix in the correct place. I guess 
 that somewhere in between r31084 and r42950 (I haven't tried to
 work out exactly where) someone slipped up when updating this 
 patch. And presumably there can't be many boards making use of
 this code otherwise someone else would have noticed already.
 
 If I had I been writing this email four months ago I would
 simply  have submitted a patch correcting
 501-ath9k-eeprom_endianess.patch.
 However that patch and its successor have now disappeared. Am I
 right in thinking that their contents have gone upstream? If 
 so I should be grateful if you would let me know how to proceed.
 Should I submit a new patch to be inserted into
 package/kernel/mac80211/patches ? Or should I try to get the fix
 into compat-wireless directly?
 
 Many thanks, Ben Mulvihill
 

Any thoughts about this? Actually I think there are three options:

 - a new patch in package/kernel/mac80211/patches reinstating 
   a couple of lines from the old 501-ath9k-eeprom_endianess.patch

 - the same fix straight into the upstream code

 - no fix at all, and instead work round the bug during installation
   by reading the ath9k calibration partition, byte-swapping certain
   fields offline and re-flashing it.
   
Thanks in advance.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] ddns-scripts sleep 10 before updating?

2015-01-16 Thread Christian Schoenebeck
Am 16.01.2015 um 03:07 schrieb Catalin Patulea:
 On Thu, Jan 15, 2015 at 3:28 PM, Christian Schoenebeck
 christian.schoeneb...@gmail.com wrote:
 I did a lot of testing with a user using satellite Internet connection.
 He quickly gets his IP from the modem but he needs to use a global dns 
 server to verify his registered ip via tcp
 because the modem buffers all udp dns requests not looking for any timeouts.
 For him it takes same seconds until the connection was established to the 
 web after getting his ip from the modem.
 Let me see if I understand.. so after his interface comes up,
 dynamic_dns_updater was getting stuck on get_registered_ip because
 the connection to the web is not yet up? Perhaps this could be handled
 by a timeout on the host/nslookup command?
 
 I also think this is an edge case - in most cases, you can call
 get_registered_ip immediately and it will work.
 
 The 5 minutes I tested the easy way.
 On my ubuntu box I ran nslookup for my own ddns-address against Google's 
 public dns in an endless loop.
 Then I send out a new ip to my ddns provider via ddns-scripts and wait.
 The longest time it takes to have a stable answer from nslookup was 4 
 minutes 10 seconds.
 Plus reserve = 5 minutes. Also the reason why check_interval minimum is set 
 to 5 minutes = 300 seconds
 in line 176 of dynamic_dns_updater.sh.
 
 I understand that the latency through Google public dns is 5 minutes,
 but not everyone uses Google public dns, and your test is not
 representative of queries for cache-cold records.
 
 I tried adding a new record to my domain to see what happens on a
 query that is not already in the cache. This is the same case as
 updating an existing DDNS entry that hasn't been accessed in a long
 time.
 
 The record was immediately (15 seconds, while I typed the commands)
 available in my DNS provider's server, my ISP's server, and 8.8.8.8.
 The intermediate servers didn't even know if the record exists, so
 they had to contact the authoritative server. Probably if I update the
 IP now, it will take a long time to propagate, but this is not a
 common case for me.
 
 What I want is that if I get a new IP/router crashes/power outage, for
 my IP to be updated in the authoritative DNS server as soon as
 possible. It is rare that I access my DDNS just before this
 (crash/power outage/etc.) happens, so the record will not be cached,
 so if I access it now, I will see the fresh IP in any DNS server. In
 this case the sleep 10 is the limiting factor.
 
 I think probably this is the case for most DDNS users - they probably
 access their records very rarely, so they are not cached, so sleep
 10 is the biggest factor to how quickly their new address is visible.
 But I can't speak definitively about any but my case.
 
 Perhaps the sleep could be a configuration option which defaults to 0.
 Specific users can set it if they need it.
 
Did you really ever run into problems because of 10 seconds delay after an 
outage of thousands of seconds ?
What do your ddns provider think about multiple updates per minute, if the 
connection toggle due to errors on your wan connection. Most providers start 
blocking for hours after to many updates.
For the moment please comment out the 4 lines starting at line 219 of 
dynamic_dns_updater.sh
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH V2 uclient] support for connection timeout

2015-01-16 Thread Rafał Miłecki
Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
V2: Add uclient_set_timeout
Stop timer after receiving data
Start timer after fetching data by uclient user
---
 uclient-fetch.c |  4 
 uclient-http.c  | 12 ++--
 uclient.c   | 36 +++-
 uclient.h   | 20 
 4 files changed, 69 insertions(+), 3 deletions(-)

diff --git a/uclient-fetch.c b/uclient-fetch.c
index 22f15c6..0617a02 100644
--- a/uclient-fetch.c
+++ b/uclient-fetch.c
@@ -194,6 +194,10 @@ static void handle_uclient_error(struct uclient *cl, int 
code)
type = Connection failed;
error_ret = 4;
break;
+   case UCLIENT_ERROR_TIMEDOUT:
+   type = Connection timed out;
+   error_ret = 4;
+   break;
case UCLIENT_ERROR_SSL_INVALID_CERT:
type = Invalid SSL certificate;
ignore = !verify;
diff --git a/uclient-http.c b/uclient-http.c
index c25e52f..38e7761 100644
--- a/uclient-http.c
+++ b/uclient-http.c
@@ -689,8 +689,12 @@ static void __uclient_notify_read(struct uclient_http *uh)
if (uh-eof)
return;
 
-   if (uh-state == HTTP_STATE_RECV_DATA  uc-cb-data_read)
-   uc-cb-data_read(uc);
+   if (uh-state == HTTP_STATE_RECV_DATA)
+   /* Now it's uclient user turn to read some data */
+   uloop_timeout_cancel(uc-connection_timeout);
+
+   if (uc-cb-data_read)
+   uc-cb-data_read(uc);
 }
 
 static void __uclient_notify_write(struct uclient_http *uh)
@@ -1030,6 +1034,10 @@ uclient_http_read(struct uclient *cl, char *buf, 
unsigned int len)
 
uclient_notify_eof(uh);
 
+   /* Now that we consumed something and if this isn't EOF, start timer 
again */
+   if (!uh-uc.eof  !cl-connection_timeout.pending)
+   uloop_timeout_set(cl-connection_timeout, cl-timeout_msecs);
+
return len;
 }
 
diff --git a/uclient.c b/uclient.c
index ab2d5b6..d599763 100644
--- a/uclient.c
+++ b/uclient.c
@@ -141,6 +141,16 @@ free:
return NULL;
 }
 
+static void uclient_connection_timeout(struct uloop_timeout *timeout)
+{
+   struct uclient *cl = container_of(timeout, struct uclient, 
connection_timeout);
+
+   if (cl-backend-disconnect)
+   cl-backend-disconnect(cl);
+
+   uclient_backend_set_error(cl, UCLIENT_ERROR_TIMEDOUT);
+}
+
 struct uclient *uclient_new(const char *url_str, const char *auth_str, const 
struct uclient_cb *cb)
 {
struct uclient *cl;
@@ -157,6 +167,8 @@ struct uclient *uclient_new(const char *url_str, const char 
*auth_str, const str
cl-backend = url-backend;
cl-cb = cb;
cl-url = url;
+   cl-timeout_msecs = UCLIENT_DEFAULT_TIMEOUT_MS;
+   cl-connection_timeout.cb = uclient_connection_timeout;
 
return cl;
 }
@@ -182,6 +194,16 @@ int uclient_set_url(struct uclient *cl, const char 
*url_str, const char *auth_st
return 0;
 }
 
+int uclient_set_timeout(struct uclient *cl, int msecs)
+{
+   if (msecs = 0)
+   return -EINVAL;
+
+   cl-timeout_msecs = msecs;
+
+   return 0;
+}
+
 int uclient_connect(struct uclient *cl)
 {
return cl-backend-connect(cl);
@@ -209,10 +231,18 @@ int uclient_write(struct uclient *cl, char *buf, int len)
 
 int uclient_request(struct uclient *cl)
 {
+   int err;
+
if (!cl-backend-request)
return -1;
 
-   return cl-backend-request(cl);
+   err = cl-backend-request(cl);
+   if (err)
+   return err;
+
+   uloop_timeout_set(cl-connection_timeout, cl-timeout_msecs);
+
+   return 0;
 }
 
 int uclient_read(struct uclient *cl, char *buf, int len)
@@ -225,6 +255,8 @@ int uclient_read(struct uclient *cl, char *buf, int len)
 
 void uclient_disconnect(struct uclient *cl)
 {
+   uloop_timeout_cancel(cl-connection_timeout);
+
if (!cl-backend-disconnect)
return;
 
@@ -252,6 +284,7 @@ void __hidden uclient_backend_set_error(struct uclient *cl, 
int code)
if (cl-error_code)
return;
 
+   uloop_timeout_cancel(cl-connection_timeout);
cl-error_code = code;
uclient_backend_change_state(cl);
 }
@@ -261,6 +294,7 @@ void __hidden uclient_backend_set_eof(struct uclient *cl)
if (cl-eof || cl-error_code)
return;
 
+   uloop_timeout_cancel(cl-connection_timeout);
cl-eof = true;
uclient_backend_change_state(cl);
 }
diff --git a/uclient.h b/uclient.h
index d5a0d5b..5904a38 100644
--- a/uclient.h
+++ b/uclient.h
@@ -24,12 +24,15 @@
 #include libubox/ustream.h
 #include libubox/ustream-ssl.h
 
+#define UCLIENT_DEFAULT_TIMEOUT_MS 3
+
 struct uclient_cb;
 struct uclient_backend;
 
 enum uclient_error_code {
UCLIENT_ERROR_UNKNOWN,
UCLIENT_ERROR_CONNECT,
+   UCLIENT_ERROR_TIMEDOUT,

Re: [OpenWrt-Devel] [PATCH V2 uclient] support for connection timeout

2015-01-16 Thread John Szakmeister
On Fri, Jan 16, 2015 at 4:42 AM, Rafał Miłecki zaj...@gmail.com wrote:
[snip]
 -   if (uh-state == HTTP_STATE_RECV_DATA  uc-cb-data_read)
 -   uc-cb-data_read(uc);
 +   if (uh-state == HTTP_STATE_RECV_DATA)
 +   /* Now it's uclient user turn to read some data */
 +   uloop_timeout_cancel(uc-connection_timeout);
 +
 +   if (uc-cb-data_read)
 +   uc-cb-data_read(uc);

The above snippet doesn't look right.  I think you probably
meant to add curly braces around the block:

if (uh-state == HTTP_STATE_RECV_DATA) {
// ...
}

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


[OpenWrt-Devel] [PATCH V3 uclient] support for connection timeout

2015-01-16 Thread Rafał Miłecki
Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
V2: Add uclient_set_timeout
Stop timer after receiving data
Start timer after fetching data by uclient user
V3: Fix missing braces in __uclient_notify_read, thanks John!
---
 uclient-fetch.c |  4 
 uclient-http.c  | 13 +++--
 uclient.c   | 36 +++-
 uclient.h   | 20 
 4 files changed, 70 insertions(+), 3 deletions(-)

diff --git a/uclient-fetch.c b/uclient-fetch.c
index 22f15c6..0617a02 100644
--- a/uclient-fetch.c
+++ b/uclient-fetch.c
@@ -194,6 +194,10 @@ static void handle_uclient_error(struct uclient *cl, int 
code)
type = Connection failed;
error_ret = 4;
break;
+   case UCLIENT_ERROR_TIMEDOUT:
+   type = Connection timed out;
+   error_ret = 4;
+   break;
case UCLIENT_ERROR_SSL_INVALID_CERT:
type = Invalid SSL certificate;
ignore = !verify;
diff --git a/uclient-http.c b/uclient-http.c
index c25e52f..af43b05 100644
--- a/uclient-http.c
+++ b/uclient-http.c
@@ -689,8 +689,13 @@ static void __uclient_notify_read(struct uclient_http *uh)
if (uh-eof)
return;
 
-   if (uh-state == HTTP_STATE_RECV_DATA  uc-cb-data_read)
-   uc-cb-data_read(uc);
+   if (uh-state == HTTP_STATE_RECV_DATA) {
+   /* Now it's uclient user turn to read some data */
+   uloop_timeout_cancel(uc-connection_timeout);
+
+   if (uc-cb-data_read)
+   uc-cb-data_read(uc);
+   }
 }
 
 static void __uclient_notify_write(struct uclient_http *uh)
@@ -1030,6 +1035,10 @@ uclient_http_read(struct uclient *cl, char *buf, 
unsigned int len)
 
uclient_notify_eof(uh);
 
+   /* Now that we consumed something and if this isn't EOF, start timer 
again */
+   if (!uh-uc.eof  !cl-connection_timeout.pending)
+   uloop_timeout_set(cl-connection_timeout, cl-timeout_msecs);
+
return len;
 }
 
diff --git a/uclient.c b/uclient.c
index ab2d5b6..d599763 100644
--- a/uclient.c
+++ b/uclient.c
@@ -141,6 +141,16 @@ free:
return NULL;
 }
 
+static void uclient_connection_timeout(struct uloop_timeout *timeout)
+{
+   struct uclient *cl = container_of(timeout, struct uclient, 
connection_timeout);
+
+   if (cl-backend-disconnect)
+   cl-backend-disconnect(cl);
+
+   uclient_backend_set_error(cl, UCLIENT_ERROR_TIMEDOUT);
+}
+
 struct uclient *uclient_new(const char *url_str, const char *auth_str, const 
struct uclient_cb *cb)
 {
struct uclient *cl;
@@ -157,6 +167,8 @@ struct uclient *uclient_new(const char *url_str, const char 
*auth_str, const str
cl-backend = url-backend;
cl-cb = cb;
cl-url = url;
+   cl-timeout_msecs = UCLIENT_DEFAULT_TIMEOUT_MS;
+   cl-connection_timeout.cb = uclient_connection_timeout;
 
return cl;
 }
@@ -182,6 +194,16 @@ int uclient_set_url(struct uclient *cl, const char 
*url_str, const char *auth_st
return 0;
 }
 
+int uclient_set_timeout(struct uclient *cl, int msecs)
+{
+   if (msecs = 0)
+   return -EINVAL;
+
+   cl-timeout_msecs = msecs;
+
+   return 0;
+}
+
 int uclient_connect(struct uclient *cl)
 {
return cl-backend-connect(cl);
@@ -209,10 +231,18 @@ int uclient_write(struct uclient *cl, char *buf, int len)
 
 int uclient_request(struct uclient *cl)
 {
+   int err;
+
if (!cl-backend-request)
return -1;
 
-   return cl-backend-request(cl);
+   err = cl-backend-request(cl);
+   if (err)
+   return err;
+
+   uloop_timeout_set(cl-connection_timeout, cl-timeout_msecs);
+
+   return 0;
 }
 
 int uclient_read(struct uclient *cl, char *buf, int len)
@@ -225,6 +255,8 @@ int uclient_read(struct uclient *cl, char *buf, int len)
 
 void uclient_disconnect(struct uclient *cl)
 {
+   uloop_timeout_cancel(cl-connection_timeout);
+
if (!cl-backend-disconnect)
return;
 
@@ -252,6 +284,7 @@ void __hidden uclient_backend_set_error(struct uclient *cl, 
int code)
if (cl-error_code)
return;
 
+   uloop_timeout_cancel(cl-connection_timeout);
cl-error_code = code;
uclient_backend_change_state(cl);
 }
@@ -261,6 +294,7 @@ void __hidden uclient_backend_set_eof(struct uclient *cl)
if (cl-eof || cl-error_code)
return;
 
+   uloop_timeout_cancel(cl-connection_timeout);
cl-eof = true;
uclient_backend_change_state(cl);
 }
diff --git a/uclient.h b/uclient.h
index d5a0d5b..5904a38 100644
--- a/uclient.h
+++ b/uclient.h
@@ -24,12 +24,15 @@
 #include libubox/ustream.h
 #include libubox/ustream-ssl.h
 
+#define UCLIENT_DEFAULT_TIMEOUT_MS 3
+
 struct uclient_cb;
 struct uclient_backend;
 
 enum uclient_error_code {
UCLIENT_ERROR_UNKNOWN,

Re: [OpenWrt-Devel] question about ath9k endianness check in eeprom_9287.c

2015-01-16 Thread Felix Fietkau
On 2015-01-16 10:12, Ben Mulvihill wrote:
 Any thoughts about this? Actually I think there are three options:
Hey Ben,

sorry for not getting back to you earlier, I was busy with a lot of stuff.

  - a new patch in package/kernel/mac80211/patches reinstating 
a couple of lines from the old 501-ath9k-eeprom_endianess.patch
 
  - the same fix straight into the upstream code
 
  - no fix at all, and instead work round the bug during installation
by reading the ath9k calibration partition, byte-swapping certain
fields offline and re-flashing it.
I intend to make a patch to unify those checks across
eeprom_{def,4k,9287}.c to get rid of duplication. I will submit that
upstream and commit it to OpenWrt

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


Re: [OpenWrt-Devel] Is Linksys/Belkin lying (again) about being open source (WRT1200AC router) ?

2015-01-16 Thread Bjørn Mork
Fernando Frediani fhfredi...@gmail.com writes:

 I'm not entirely sure of the status of WRT1200AC, but if there is
 nothing here in OpenWRT and nothing else much can be found on the web
 they are once again lying. They are publishing intentions as if it was
 something that was already done and consolidated, ready for any buyer
 to enjoy. If there is something going on between them and OpenWRT we
 are not aware, at least not via this list.

You should probably take a closer look at these two emails. Preferably
in your own list archive if you have one, as the pipermail archive is
missing some of the more interesting details.  Like who Marvell chose to
CC the driver announcement to, and which email address they used

https://lists.openwrt.org/pipermail/openwrt-devel/2014-December/030229.html
https://lists.openwrt.org/pipermail/openwrt-devel/2015-January/030526.html

I might be reading too much between the lines here, but this looks very
promising to me.

Yes, I also regularily get frustrated with marketing people overselling
features, and selling them before they are ready.  But you should
realize that Belkin is not the only vendor doing that. The really
annoying thing with the WRTs is that they oversell a feature we care
so deeply about - opensource support. But I believe we should appreciate
the fact that the marketing people find this feature interesting, and do
our best to keep it that way.  And just realize that overselling is part
of the game.

In any case, we are much better off if this list is used for technical
discussions instead of vendor bashing.


Bjørn (with absolutely no shares in neither Belkin, Marvell nor OpenWRT)
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Is Linksys/Belkin lying (again) about being open source (WRT1200AC router) ?

2015-01-16 Thread Jacek Kikiewicz
Hi,

I don't get this discussion, few days Imre Kaloz admitted he will work on 
WRT1200AC so this
means that Belkin reached out to him...

Regards,
Jacek

On 16.01.2015 12:45, Bjørn Mork wrote:
 Fernando Frediani fhfredi...@gmail.com writes:
 
 I'm not entirely sure of the status of WRT1200AC, but if there is
 nothing here in OpenWRT and nothing else much can be found on the web
 they are once again lying. They are publishing intentions as if it was
 something that was already done and consolidated, ready for any buyer
 to enjoy. If there is something going on between them and OpenWRT we
 are not aware, at least not via this list.
 
 You should probably take a closer look at these two emails. Preferably
 in your own list archive if you have one, as the pipermail archive is
 missing some of the more interesting details.  Like who Marvell chose to
 CC the driver announcement to, and which email address they used
 
 https://lists.openwrt.org/pipermail/openwrt-devel/2014-December/030229.html
 https://lists.openwrt.org/pipermail/openwrt-devel/2015-January/030526.html
 
 I might be reading too much between the lines here, but this looks very
 promising to me.
 
 Yes, I also regularily get frustrated with marketing people overselling
 features, and selling them before they are ready.  But you should
 realize that Belkin is not the only vendor doing that. The really
 annoying thing with the WRTs is that they oversell a feature we care
 so deeply about - opensource support. But I believe we should appreciate
 the fact that the marketing people find this feature interesting, and do
 our best to keep it that way.  And just realize that overselling is part
 of the game.
 
 In any case, we are much better off if this list is used for technical
 discussions instead of vendor bashing.
 
 
 Bjørn (with absolutely no shares in neither Belkin, Marvell nor OpenWRT)
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Is Linksys/Belkin lying (again) about being open source (WRT1200AC router) ?

2015-01-16 Thread Bjørn Mork
Jacek Kikiewicz ja...@aol.pl writes:

 I don't get this discussion, few days Imre Kaloz admitted he will work
 on WRT1200AC so this means that Belkin reached out to him...

Yes, that's what I subtly tried to point out with the list archive
references :-)


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


[OpenWrt-Devel] [PATCH] ar71xx: add support for TP-LINK TL-WA701ND v2

2015-01-16 Thread Luigi Tarenga
Signed-off-by: Luigi Tarenga luigi.tare...@gmail.com
---
I send the patch again, maybe it was not formatted correctly.
please let me know if there is any problem in how i send it.

regards
Luigi
---
 package/libs/openssl/Makefile |  6 +++---
 package/libs/openssl/patches/150-no_engines.patch | 18 +-
 package/libs/openssl/patches/200-parallel_build.patch |  8 
 package/network/ipv6/map/Makefile |  7 ---
 package/network/ipv6/map/files/map.sh |  3 +++
 package/network/ipv6/map/src/mapcalc.c|  6 --
 6 files changed, 27 insertions(+), 21 deletions(-)

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh
b/target/linux/ar71xx/base-files/etc/diag.sh
index fa07f39..eb96338 100755
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -195,6 +195,7 @@ get_status_led() {
 tl-mr3220-v2 | \
 tl-mr3420 | \
 tl-mr3420-v2 | \
+tl-wa701nd-v2 | \
 tl-wa801nd-v2 | \
 tl-wa901nd | \
 tl-wa901nd-v2 | \
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
index 5b9dbe7..51c2bca 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -275,7 +275,11 @@ tl-wa850re)
 ucidef_set_led_rssi rssihigh RSSIHIGH tp-link:blue:signal5
wlan0 80 100 -79 13
 ;;

-tl-wa860re)
+tl-wa701nd-v2 | \
+tl-wa830re-v2 | \
+tl-wa860re | \
+tl-wa801nd-v2 | \
+tl-wa901nd-v3)
 ucidef_set_led_netdev lan LAN tp-link:green:lan eth0
 ucidef_set_led_wlan wlan WLAN tp-link:green:wlan phy0tpt
 ;;
@@ -333,11 +337,6 @@ tl-wr841n-v8)
 ucidef_set_led_wlan wlan WLAN tp-link:green:wlan phy0tpt
 ;;

-tl-wa830re-v2)
-ucidef_set_led_netdev lan LAN tp-link:green:lan eth0
-ucidef_set_led_wlan wlan WLAN tp-link:green:wlan phy0tpt
-;;
-
 tl-wr841n-v9)
 ucidef_set_led_netdev wan WAN tp-link:green:wan eth1
 ucidef_set_led_switch lan1 LAN1 tp-link:green:lan1 switch0 0x10
@@ -357,12 +356,6 @@ tl-wr842n-v2)
 ucidef_set_led_usbdev usb USB tp-link:green:3g 1-1
 ;;

-tl-wa801nd-v2 | \
-tl-wa901nd-v3)
-ucidef_set_led_netdev lan LAN tp-link:green:lan eth0
-ucidef_set_led_wlan wlan WLAN tp-link:green:wlan phy0tpt
-;;
-
 tl-wr941nd | \
 tl-wr1041n-v2)
 ucidef_set_led_wlan wlan WLAN tp-link:green:wlan phy0tpt
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
index c5cfd67..4be30b8 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -301,6 +301,7 @@ tl-mr13u |\
 tl-mr3020 |\
 tl-mr3040 |\
 tl-mr3040-v2 |\
+tl-wa701nd-v2 |\
 tl-wa750re |\
 tl-wa850re |\
 tl-wa830re-v2 |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 1e96b6d..df35775 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -571,6 +571,9 @@ ar71xx_board_detect() {
 *TL-MR3420 v2)
 name=tl-mr3420-v2
 ;;
+*TL-WA701ND v2)
+name=tl-wa701nd-v2
+;;
 *TL-WA750RE)
 name=tl-wa750re
 ;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 846954c..eeaac6a 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -269,6 +269,7 @@ platform_check_image() {
 tl-mr3220-v2 | \
 tl-mr3420 | \
 tl-mr3420-v2 | \
+tl-wa701nd-v2 | \
 tl-wa7510n | \
 tl-wa750re | \
 tl-wa850re | \
diff --git a/target/linux/ar71xx/config-3.10 b/target/linux/ar71xx/config-3.10
index 9a8378a..482914a 100644
--- a/target/linux/ar71xx/config-3.10
+++ b/target/linux/ar71xx/config-3.10
@@ -88,6 +88,7 @@ CONFIG_ATH79_MACH_TL_MR11U=y
 CONFIG_ATH79_MACH_TL_MR13U=y
 CONFIG_ATH79_MACH_TL_MR3020=y
 CONFIG_ATH79_MACH_TL_MR3X20=y
+CONFIG_ATH79_MACH_TL_WA701ND_V2=y
 CONFIG_ATH79_MACH_TL_WA830RE_V2=y
 CONFIG_ATH79_MACH_TL_WA901ND=y
 CONFIG_ATH79_MACH_TL_WA901ND_V2=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa701nd-v2.c
b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa701nd-v2.c
new file mode 100644
index 000..aab92b3
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa701nd-v2.c
@@ -0,0 +1,116 @@
+/*
+ *  TP-LINK TL-WA701ND v2 board support
+ *
+ *  Copyright (C) 2015 Luigi Tarenga luigi.tare...@gmail.com
+ *
+ *  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 linux/gpio.h
+
+#include asm/mach-ath79/ath79.h
+
+#include dev-eth.h
+#include 

Re: [OpenWrt-Devel] [PATCH 8/9] mvebu: Add the Armada 385 Reference Design support

2015-01-16 Thread Maxime Ripard
Hi Imre,

On Wed, Jan 14, 2015 at 12:50:55PM +0100, Imre Kaloz wrote:
 On Tue, 13 Jan 2015 16:56:45 +0100, Maxime Ripard
 maxime.rip...@free-electrons.com wrote:
 
 ++   partition@2 {
 ++   label = data;
 ++   reg = 0x60 0xa0;
 ++   };
 +};
 +};
 +
 
 This one should be called rootfs. The image/Makefile change should be part
 of the UBI on NOR discussion/patch, so please make that one a separate.

You mean a separate patch, right?

Separated from what? The rest of the serie? This patch is pretty
standalone by itself.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


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


Re: [OpenWrt-Devel] [PATCH 4/9] mvebu: Add sub-profiles

2015-01-16 Thread Maxime Ripard
Hi,

On Wed, Jan 14, 2015 at 01:03:49PM +0100, Imre Kaloz wrote:
 Hi Maxime,
 
 On Tue, 13 Jan 2015 16:56:41 +0100, Maxime Ripard
 maxime.rip...@free-electrons.com wrote:
 
 +$(eval $(call MultiProfile,Generic,$(PROFILES_LIST)))
 +$(eval $(call MultiProfile,Evalboards,$(PROFILES_LIST)))
 
 Profile names should be sourced from the profiles.
 
 -$(foreach nandboard,$(NANDBOARDS),$(call
 BuildSysupgrade,$(1),$(nandboard));)
 +$(call Image/Build/Profile/$(PROFILE)/BuildSysupgrade,$(1))
 
 UBI and BuildSysUpgrade is there for NAND only.

Ok. I still think UBI might be a good choice for some !NAND-based
boards, but point taken for BuildSysUpgrade.

 On boards with nor (unless you come up with a really good reason to hack
 UBI)

It's not really a hack. UBI is perfectly capable on running on NOR,
and it's even mentionned in their documentation on various occasions.

 you should stick to squashfs+jffs2.

Ok.

 Also, each NOR based board should have firmware partition and use
 the OpenWrt MTDSPLIT framework and should have a single, flashable
 firmware image file created instead of separate uImage+rootfs stuff.

I'm not really familiar with MTDSPLIT, but I'll look into that. Thanks!

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


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


Re: [OpenWrt-Devel] [PATCH 9/9] mvebu: Add Armada 385 DB AP support

2015-01-16 Thread Maxime Ripard
On Wed, Jan 14, 2015 at 12:52:56PM +0100, Imre Kaloz wrote:
 On Tue, 13 Jan 2015 16:56:46 +0100, Maxime Ripard
 maxime.rip...@free-electrons.com wrote:
 
 +diff --git a/arch/arm/boot/dts/armada-385-db-ap.dts
 b/arch/arm/boot/dts/armada-385-db-ap.dts
 +index 02db04867d8f..2a58443e2504 100644
 +--- a/arch/arm/boot/dts/armada-385-db-ap.dts
  b/arch/arm/boot/dts/armada-385-db-ap.dts
 +@@ -134,6 +134,21 @@
 +marvell,nand-keep-config;
 +marvell,nand-enable-arbiter;
 +nand-on-flash-bbt;
 ++
 ++   mtd0@ {
 ++   label = U-Boot;
 ++   reg = 0x 0x0080;
 ++   };
 ++
 ++   mtd1@0080 {
 ++   label = uImage;
 ++   reg = 0x0080 0x0080;
 ++   };
 ++
 ++   mtd2@0100 {
 ++   label = Root;
 ++   reg = 0x0100 0x3f00;
 ++   };
 +};
 +};
 +
 
 I think this should be u-boot, kernel and (at least in OpenWrt),
 ubi.

Ok, will change.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


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


Re: [OpenWrt-Devel] [PATCH 8/9] mvebu: Add the Armada 385 Reference Design support

2015-01-16 Thread Imre Kaloz
On Fri, 16 Jan 2015 16:23:43 +0100, Maxime Ripard  
maxime.rip...@free-electrons.com wrote:



Hi Imre,

On Wed, Jan 14, 2015 at 12:50:55PM +0100, Imre Kaloz wrote:

On Tue, 13 Jan 2015 16:56:45 +0100, Maxime Ripard
maxime.rip...@free-electrons.com wrote:

++  partition@2 {
++  label = data;
++  reg = 0x60 0xa0;
++  };
+   };
+   };
+

This one should be called rootfs. The image/Makefile change should be  
part

of the UBI on NOR discussion/patch, so please make that one a separate.


You mean a separate patch, right?

Separated from what? The rest of the serie? This patch is pretty
standalone by itself.


Sorry, I wanted to say that one patch should add the partitions and  
another should be the image/Makefile change, given the first is likely to  
be upstreamed.



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


Re: [OpenWrt-Devel] [PATCH 8/9] mvebu: Add the Armada 385 Reference Design support

2015-01-16 Thread Maxime Ripard
On Fri, Jan 16, 2015 at 04:38:47PM +0100, Imre Kaloz wrote:
 On Fri, 16 Jan 2015 16:23:43 +0100, Maxime Ripard
 maxime.rip...@free-electrons.com wrote:
 
 Hi Imre,
 
 On Wed, Jan 14, 2015 at 12:50:55PM +0100, Imre Kaloz wrote:
 On Tue, 13 Jan 2015 16:56:45 +0100, Maxime Ripard
 maxime.rip...@free-electrons.com wrote:
 
 ++ partition@2 {
 ++ label = data;
 ++ reg = 0x60 0xa0;
 ++ };
 +  };
 +  };
 +
 
 This one should be called rootfs. The image/Makefile change should be
 part
 of the UBI on NOR discussion/patch, so please make that one a separate.
 
 You mean a separate patch, right?
 
 Separated from what? The rest of the serie? This patch is pretty
 standalone by itself.
 
 Sorry, I wanted to say that one patch should add the partitions and another
 should be the image/Makefile change, given the first is likely to be
 upstreamed.

I don't really think it can. This kind of data is really setup
specific, and I'm not sure that the mainline kernel wants to enforce
any kind of policy there.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


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


Re: [OpenWrt-Devel] [PATCH 8/9] mvebu: Add the Armada 385 Reference Design support

2015-01-16 Thread Imre Kaloz
On Fri, 16 Jan 2015 16:52:05 +0100, Thomas Petazzoni  
thomas.petazz...@free-electrons.com wrote:



Dear Imre Kaloz,

On Fri, 16 Jan 2015 16:38:47 +0100, Imre Kaloz wrote:


 Separated from what? The rest of the serie? This patch is pretty
 standalone by itself.

Sorry, I wanted to say that one patch should add the partitions and
another should be the image/Makefile change, given the first is likely  
to

be upstreamed.


I am not sure the specific partitioning used by OpenWRT is something we
want to upstream in the mainline kernel. To me, the choice made by
Maxime of having a separate kernel patch to do that is the right
choice, since we're not sure we want to upstream specifically this
partitioning in mainline.


Judging from the patch mainline has nothing defined, and if it ever will  
have, we'll end up patching that.. Anyways, if Maxime migrates this to the  
MTDSPLIT stuff, we'll have only u-boot and firmware.



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


Re: [OpenWrt-Devel] ddns-scripts sleep 10 before updating?

2015-01-16 Thread Catalin Patulea
On Fri, Jan 16, 2015 at 4:36 AM, Christian Schoenebeck
christian.schoeneb...@gmail.com wrote:
 Did you really ever run into problems because of 10 seconds delay after an 
 outage of thousands of seconds ?
No, but I don't want to wait until I have a problem. ddns-scripts
should do the best it can to update the record quickly.

 What do your ddns provider think about multiple updates per minute, if the 
 connection toggle due to errors on your wan connection. Most providers start 
 blocking for hours after to many updates.
First you said the sleep was because netifd runs the script too early.
That turned out to be false. Now you're saying it's to be nice to the
ddns provider - I don't think it's a problem and sleep is the wrong
way to solve it anyway.

As John Crispin recently said in a different patch review, using
magic delays is a no go:
https://lists.openwrt.org/pipermail/openwrt-devel/2015-January/030561.html

That is exactly what this sleep 10 is - some arbitrary value that
doesn't seem to have a specific purpose, added to fix one minority
edge case - or maybe no one remembers why it was added.

 For the moment please comment out the 4 lines starting at line 219 of 
 dynamic_dns_updater.sh
No. I do not maintain one router, I maintain several of them. I will
not go around editing dynamic_dns_updater.sh on them all, and have to
do this again every time I flash a new version.

I do not want to maintain a diff compared to openwrt master either,
because that will just give merge headaches in the future.

Please, what is the reason sleep 10 is still there? Was it because of
the early netifd call - then let's just remove it. If it is only to
fix the satellite user case, then maybe that use should be the one to
modify dynamic_dns_updater.sh on their router. But right now, for the
majority of cases, it adds a 10 second delay for no reason. I don't
think this is right.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] add pkgconfig information for popt library

2015-01-16 Thread Mike Brady
I meant to mention that, as well as being A Good Thing in general, this would 
make is possible for me to bring shairport-sync 
(https://github.com/mikebrady/shairport-sync) over to OpenWrt without having to 
patch its configuration file.

 Modify makefile to record pkgconfig information for the popt library.

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


[OpenWrt-Devel] [PATCH] ar71xx: fix board detection for TP-LINK TL-WA860RE

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

diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index a12101a..78a0cef 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -645,6 +645,9 @@ ar71xx_board_detect() {
*TL-WA850RE)
name=tl-wa850re
;;
+   *TL-WA860RE)
+   name=tl-wa860re
+   ;;
*TL-WA830RE v2)
name=tl-wa830re-v2
;;
-- 
2.2.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH uqmi] Add command to specify preferred PLMN

2015-01-16 Thread Sławomir Demeszko
Signed-off-by: Sławomir Demeszko s.demes...@wireless-instruments.com
---
 commands-nas.c | 60 ++
 commands-nas.h |  6 ++
 2 files changed, 66 insertions(+)

diff --git a/commands-nas.c b/commands-nas.c
index 831e3f4..33477dd 100644
--- a/commands-nas.c
+++ b/commands-nas.c
@@ -1,6 +1,10 @@
 #include qmi-message.h
 
 static struct qmi_nas_set_system_selection_preference_request sel_req;
+static struct  {
+   bool mcc_is_set;
+   bool mnc_is_set;
+} plmn_code_flag;
 
 #define cmd_nas_do_set_system_selection_cb no_cb
 static enum qmi_cmd_result
@@ -99,6 +103,62 @@ cmd_nas_set_roaming_prepare(struct qmi_dev *qmi, struct 
qmi_request *req, struct
return do_sel_network();
 }
 
+#define cmd_nas_set_mcc_cb no_cb
+static enum qmi_cmd_result
+cmd_nas_set_mcc_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct 
qmi_msg *msg, char *arg)
+{
+   char *err;
+   int value = strtoul(arg, err, 10);
+   if (err  *err) {
+   uqmi_add_error(Invalid MCC value);
+   return QMI_CMD_EXIT;
+   }
+
+   sel_req.data.network_selection_preference.mcc = value;
+   plmn_code_flag.mcc_is_set = true;
+   return QMI_CMD_DONE;
+}
+
+#define cmd_nas_set_mnc_cb no_cb
+static enum qmi_cmd_result
+cmd_nas_set_mnc_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct 
qmi_msg *msg, char *arg)
+{
+   char *err;
+   int value = strtoul(arg, err, 10);
+   if (err  *err) {
+   uqmi_add_error(Invalid MNC value);
+   return QMI_CMD_EXIT;
+   }
+
+   sel_req.data.network_selection_preference.mnc = value;
+   plmn_code_flag.mnc_is_set = true;
+   return QMI_CMD_DONE;
+}
+
+#define cmd_nas_set_plmn_cb no_cb
+static enum qmi_cmd_result
+cmd_nas_set_plmn_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct 
qmi_msg *msg, char *arg)
+{
+   sel_req.set.network_selection_preference = 1;
+   sel_req.data.network_selection_preference.mode = 
QMI_NAS_NETWORK_SELECTION_PREFERENCE_AUTOMATIC;
+
+   if (!plmn_code_flag.mcc_is_set  plmn_code_flag.mnc_is_set) {
+   uqmi_add_error(No MCC value);
+   return QMI_CMD_EXIT;
+   }
+
+   if (plmn_code_flag.mcc_is_set  
sel_req.data.network_selection_preference.mcc) {
+   if (!plmn_code_flag.mnc_is_set) {
+   uqmi_add_error(No MNC value);
+   return QMI_CMD_EXIT;
+   } else {
+   sel_req.data.network_selection_preference.mode = 
QMI_NAS_NETWORK_SELECTION_PREFERENCE_MANUAL;
+   }
+   }
+
+   return do_sel_network();
+}
+
 #define cmd_nas_initiate_network_register_cb no_cb
 static enum qmi_cmd_result
 cmd_nas_initiate_network_register_prepare(struct qmi_dev *qmi, struct 
qmi_request *req, struct qmi_msg *msg, char *arg)
diff --git a/commands-nas.h b/commands-nas.h
index 4a4dace..d2bde7b 100644
--- a/commands-nas.h
+++ b/commands-nas.h
@@ -2,6 +2,9 @@
__uqmi_command(nas_do_set_system_selection, __set-system-selection, no, 
QMI_SERVICE_NAS), \
__uqmi_command(nas_set_network_modes, set-network-modes, required, 
CMD_TYPE_OPTION), \
__uqmi_command(nas_initiate_network_register, network-register, no, 
QMI_SERVICE_NAS), \
+   __uqmi_command(nas_set_plmn, set-plmn, no, QMI_SERVICE_NAS), \
+   __uqmi_command(nas_set_mcc, mcc, required, CMD_TYPE_OPTION), \
+   __uqmi_command(nas_set_mnc, mnc, required, CMD_TYPE_OPTION), \
__uqmi_command(nas_network_scan, network-scan, no, QMI_SERVICE_NAS), \
__uqmi_command(nas_get_signal_info, get-signal-info, no, 
QMI_SERVICE_NAS), \
__uqmi_command(nas_get_serving_system, get-serving-system, no, 
QMI_SERVICE_NAS), \
@@ -17,6 +20,9 @@
Available modes: any, off, 
only\n \
  --network-scan:   Initiate network scan\n \
  --network-register:   Initiate network 
register\n \
+ --set-plmn:   Register at specified 
network\n \
+   --mcc mcc:Mobile Country Code (0 - 
auto)\n \
+   --mnc mnc:Mobile Network Code\n \
  --get-signal-info:Get signal strength 
info\n \
  --get-serving-system: Get serving system info\n 
\
 
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] procd: delay inittab workers until the tty exists.

2015-01-16 Thread Owen Kirby

Okay, I'll rewrite it.

However: Is it polling for the existence of the tty device that is 
unacceptable (would a solution using uloop_timeout_set() be okay?), or 
would I need to process hotplug events from the kernel?


Thanks,
Owen

On 15-01-15 10:31 PM, John Crispin wrote:

nack, using magic delays is a no go

On 16/01/2015 04:15, Owen Kirby wrote:

If a process with a tty is specified in inittab, delay the worker
process until the tty exists.

This allows starting consoles with terminals that get delayed until
after procd is reads inittab,
and it also allows hotplugging USB-to-serial adapters attached long
after booting.

Signed-off-by: Owen Kirby o...@exegin.com
---
  inittab.c | 14 ++
  1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/inittab.c b/inittab.c
index 623103d..73c113f 100644
--- a/inittab.c
+++ b/inittab.c
@@ -99,9 +99,15 @@ static void fork_worker(struct init_action *a)
  if (!a-proc.pid) {
  p = setsid();
  
-fd = dev_open(a-id);

-if (fd != -1)
-{
+if (a-id) {
+struct timespec tm;
+tm.tv_sec = a-respawn / 1000;
+tm.tv_nsec = (a-respawn % 1000) * 100;
+
+while ((fd = dev_open(a-id)) == -1)
+if (nanosleep(tm, NULL) == -1)
+exit(-1);
+
  dup2(fd, STDIN_FILENO);
  dup2(fd, STDOUT_FILENO);
  dup2(fd, STDERR_FILENO);
@@ -157,7 +163,7 @@ static void askfirst(struct init_action *a)
  {
  int i;
  
-if (!dev_exist(a-id) || (console  !strcmp(console, a-id))) {

+if (console  !strcmp(console, a-id)) {
  DEBUG(4, Skipping %s\n, a-id);
  return;
  }

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


[OpenWrt-Devel] [PATCH] build: allow openwrt.git packages to be replaced by feeds

2015-01-16 Thread Mathieu Olivari
Currently, replacing a package available in openwrt.git requires
modifications in openwrt.git, or requires duplicating the package in a
feed but with a different name, which causes all kind of problems
related to dependencies (all packages selecting it would have to be
modified accordingly to select the new package).

With this change, if a package with the same name is present both in
feeds/ and package/ folders, the one in feeds/ will override the one
in package/, both in the menuconfig and during the build.

This mechanism is particularly useful for vendor tree, or in general for
application which needs to replace one particular package which exists
within openwrt.git by a custom/newer version.

Signed-off-by: Mathieu Olivari math...@qca.qualcomm.com
---
 include/scan.awk |   17 +
 include/scan.mk  |2 +-
 scripts/feeds|9 ++---
 3 files changed, 24 insertions(+), 4 deletions(-)
 create mode 100644 include/scan.awk

diff --git a/include/scan.awk b/include/scan.awk
new file mode 100644
index 000..39b2977
--- /dev/null
+++ b/include/scan.awk
@@ -0,0 +1,17 @@
+BEGIN { FS=/ }
+$1 ~ /^feeds/ { FEEDS[$NF]=$0 }
+$1 !~ /^feeds/ { PKGS[$NF]=$0 }
+END {
+   # Filter-out OpenWrt packages which have a feeds equivalent
+   for (pkg in PKGS)
+   if (pkg in FEEDS)
+   delete PKGS[pkg]
+   n = asort(PKGS)
+   for (i=1; i = n; i++) {
+   print PKGS[i]
+   }
+   n = asort(FEEDS)
+   for (i=1; i = n; i++){
+   print FEEDS[i]
+   }
+}
diff --git a/include/scan.mk b/include/scan.mk
index 0998333..138707d 100644
--- a/include/scan.mk
+++ b/include/scan.mk
@@ -43,7 +43,7 @@ endef
 
 $(FILELIST):
rm -f $(TMP_DIR)/info/.files-$(SCAN_TARGET)-*
-   $(call FIND_L, $(SCAN_DIR)) $(SCAN_EXTRA) -mindepth 1 $(if 
$(SCAN_DEPTH),-maxdepth $(SCAN_DEPTH)) -name Makefile | xargs grep -HE 'call 
(Build/DefaultTargets|Build(Package|Target)|.+Package)' | sed -e 
's#^$(SCAN_DIR)/##' -e 's#/Makefile:.*##' | uniq  $@
+   $(call FIND_L, $(SCAN_DIR)) $(SCAN_EXTRA) -mindepth 1 $(if 
$(SCAN_DEPTH),-maxdepth $(SCAN_DEPTH)) -name Makefile | xargs grep -HE 'call 
(Build/DefaultTargets|Build(Package|Target)|.+Package)' | sed -e 
's#^$(SCAN_DIR)/##' -e 's#/Makefile:.*##' | uniq | awk -f include/scan.awk  $@
 
 $(TMP_DIR)/info/.files-$(SCAN_TARGET).mk: $(FILELIST)
( \
diff --git a/scripts/feeds b/scripts/feeds
index 31ad544..01d9041 100755
--- a/scripts/feeds
+++ b/scripts/feeds
@@ -384,12 +384,15 @@ sub install_package {
 
# previously installed packages set the runtime package
# newly installed packages set the source package
-   $installed{$src} and return 0;
+   $installed{$src} and !is_core_package($src) and return 0;
 
# check previously installed packages
-   $installed{$name} and return 0;
+   $installed{$name} and !is_core_package($name) and return 0;
$installed{$src} = 1;
-   warn Installing package '$src'\n;
+
+   is_core_package($src)
+   and warn Overriding package '$src'\n
+   or warn Installing package '$src'\n;
 
$install_method{$type} or do {
warn Unknown installation method: '$type'\n;
-- 
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] ddns-scripts sleep 10 before updating?

2015-01-16 Thread Christian Schoenebeck
Am 16.01.2015 um 17:50 schrieb Catalin Patulea:
 On Fri, Jan 16, 2015 at 4:36 AM, Christian Schoenebeck
 christian.schoeneb...@gmail.com wrote:
 Did you really ever run into problems because of 10 seconds delay after an 
 outage of thousands of seconds ?
 No, but I don't want to wait until I have a problem. ddns-scripts
 should do the best it can to update the record quickly.
 
 What do your ddns provider think about multiple updates per minute, if the 
 connection toggle due to errors on your wan connection. Most providers start 
 blocking for hours after to many updates.
 First you said the sleep was because netifd runs the script too early.
 That turned out to be false. Now you're saying it's to be nice to the
 ddns provider - I don't think it's a problem and sleep is the wrong
 way to solve it anyway.
 
 As John Crispin recently said in a different patch review, using
 magic delays is a no go:
 https://lists.openwrt.org/pipermail/openwrt-devel/2015-January/030561.html
 
 That is exactly what this sleep 10 is - some arbitrary value that
 doesn't seem to have a specific purpose, added to fix one minority
 edge case - or maybe no one remembers why it was added.
 
 For the moment please comment out the 4 lines starting at line 219 of 
 dynamic_dns_updater.sh
 No. I do not maintain one router, I maintain several of them. I will
 not go around editing dynamic_dns_updater.sh on them all, and have to
 do this again every time I flash a new version.
 
 I do not want to maintain a diff compared to openwrt master either,
 because that will just give merge headaches in the future.
 
 Please, what is the reason sleep 10 is still there? Was it because of
 the early netifd call - then let's just remove it. If it is only to
 fix the satellite user case, then maybe that use should be the one to
 modify dynamic_dns_updater.sh on their router. But right now, for the
 majority of cases, it adds a 10 second delay for no reason. I don't
 think this is right.
 
Removed in 2.1.0-5
Christian
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] ddns-scripts 2.0.1-1 breaks freedns.afraid.org?

2015-01-16 Thread Christian Schoenebeck
Implemented in 2.1.0-5 including your other suggested changes.
Christian

Am 15.01.2015 um 06:07 schrieb Catalin Patulea:
 I've opened a pull request for this (and other misc fixes):
 https://github.com/openwrt/packages/pull/779
 
 On Tue, Jan 13, 2015 at 9:14 AM, Christian Schoenebeck
 christian.schoeneb...@gmail.com wrote:
 I put it on the TODO list.
 Thanks for feedback
 Christian
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] procd: delay inittab workers until the tty exists.

2015-01-16 Thread John Crispin


On 16/01/2015 21:19, Owen Kirby wrote:
 Okay, I'll rewrite it.
 
 However: Is it polling for the existence of the tty device that is 
 unacceptable (would a solution using uloop_timeout_set() be okay?),
 or would I need to process hotplug events from the kernel?
 

use hotplug events please



 Thanks, Owen
 
 On 15-01-15 10:31 PM, John Crispin wrote:
 nack, using magic delays is a no go
 
 On 16/01/2015 04:15, Owen Kirby wrote:
 If a process with a tty is specified in inittab, delay the
 worker process until the tty exists.
 
 This allows starting consoles with terminals that get delayed
 until after procd is reads inittab, and it also allows
 hotplugging USB-to-serial adapters attached long after
 booting.
 
 Signed-off-by: Owen Kirby o...@exegin.com --- inittab.c | 14
 ++ 1 file changed, 10 insertions(+), 4
 deletions(-)
 
 diff --git a/inittab.c b/inittab.c index 623103d..73c113f
 100644 --- a/inittab.c +++ b/inittab.c @@ -99,9 +99,15 @@
 static void fork_worker(struct init_action *a) if
 (!a-proc.pid) { p = setsid(); -fd = dev_open(a-id); -
 if (fd != -1) -{ +if (a-id) { +
 struct timespec tm; +tm.tv_sec = a-respawn /
 1000; +tm.tv_nsec = (a-respawn % 1000) * 100; 
 + +while ((fd = dev_open(a-id)) == -1) +
 if (nanosleep(tm, NULL) == -1) +exit(-1); 
 + dup2(fd, STDIN_FILENO); dup2(fd, STDOUT_FILENO); dup2(fd,
 STDERR_FILENO); @@ -157,7 +163,7 @@ static void askfirst(struct
 init_action *a) { int i; -if (!dev_exist(a-id) || (console
  !strcmp(console, a-id))) { +if (console 
 !strcmp(console, a-id)) { DEBUG(4, Skipping %s\n, a-id); 
 return; }
 ___ openwrt-devel
 mailing list openwrt-devel@lists.openwrt.org 
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] build: allow openwrt.git packages to be replaced by feeds

2015-01-16 Thread John Crispin


On 16/01/2015 22:45, Mathieu Olivari wrote:
 Currently, replacing a package available in openwrt.git requires 
 modifications in openwrt.git, or requires duplicating the package
 in a feed but with a different name, which causes all kind of
 problems related to dependencies (all packages selecting it would
 have to be modified accordingly to select the new package).
 
 With this change, if a package with the same name is present both
 in feeds/ and package/ folders, the one in feeds/ will override the
 one in package/, both in the menuconfig and during the build.
 
 This mechanism is particularly useful for vendor tree, or in
 general for application which needs to replace one particular
 package which exists within openwrt.git by a custom/newer version.
 

i think this is a bad solution. this is like overriding files in /sbin
with ones in ~/sbin. it will cause lots of side effects and bogus bug
reports. how about you simply upstream your magic feature and have it
added to packages.git ? your patch seems to work around qca not
upstreaming its work properly.


 Signed-off-by: Mathieu Olivari math...@qca.qualcomm.com --- 
 include/scan.awk |   17 + include/scan.mk  |2
 +- scripts/feeds|9 ++--- 3 files changed, 24
 insertions(+), 4 deletions(-) create mode 100644 include/scan.awk
 
 diff --git a/include/scan.awk b/include/scan.awk new file mode
 100644 index 000..39b2977 --- /dev/null +++ b/include/scan.awk 
 @@ -0,0 +1,17 @@ +BEGIN { FS=/ } +$1 ~ /^feeds/ { FEEDS[$NF]=$0
 } +$1 !~ /^feeds/ { PKGS[$NF]=$0 } +END { +   # Filter-out OpenWrt
 packages which have a feeds equivalent +  for (pkg in PKGS) + 
 if
 (pkg in FEEDS) +  delete PKGS[pkg] +  n = asort(PKGS) 
 +   for (i=1; i
 = n; i++) { +print PKGS[i] + } + n = asort(FEEDS) +  
 for (i=1; i
 = n; i++){ + print FEEDS[i] +} +} diff --git 
 a/include/scan.mk
 b/include/scan.mk index 0998333..138707d 100644 ---
 a/include/scan.mk +++ b/include/scan.mk @@ -43,7 +43,7 @@ endef
 
 $(FILELIST): rm -f $(TMP_DIR)/info/.files-$(SCAN_TARGET)-* -  $(call
 FIND_L, $(SCAN_DIR)) $(SCAN_EXTRA) -mindepth 1 $(if
 $(SCAN_DEPTH),-maxdepth $(SCAN_DEPTH)) -name Makefile | xargs grep
 -HE 'call (Build/DefaultTargets|Build(Package|Target)|.+Package)' |
 sed -e 's#^$(SCAN_DIR)/##' -e 's#/Makefile:.*##' | uniq  $@ +
 $(call FIND_L, $(SCAN_DIR)) $(SCAN_EXTRA) -mindepth 1 $(if
 $(SCAN_DEPTH),-maxdepth $(SCAN_DEPTH)) -name Makefile | xargs grep
 -HE 'call (Build/DefaultTargets|Build(Package|Target)|.+Package)' |
 sed -e 's#^$(SCAN_DIR)/##' -e 's#/Makefile:.*##' | uniq | awk -f
 include/scan.awk  $@
 
 $(TMP_DIR)/info/.files-$(SCAN_TARGET).mk: $(FILELIST) ( \ diff
 --git a/scripts/feeds b/scripts/feeds index 31ad544..01d9041
 100755 --- a/scripts/feeds +++ b/scripts/feeds @@ -384,12 +384,15
 @@ sub install_package {
 
 # previously installed packages set the runtime package # newly
 installed packages set the source package -   $installed{$src} and
 return 0; +   $installed{$src} and !is_core_package($src) and return
 0;
 
 # check previously installed packages -   $installed{$name} and
 return 0; +   $installed{$name} and !is_core_package($name) and
 return 0; $installed{$src} = 1; - warn Installing package
 '$src'\n; + +is_core_package($src) + and warn Overriding
 package '$src'\n +   or warn Installing package '$src'\n;
 
 $install_method{$type} or do { warn Unknown installation method:
 '$type'\n;
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Archer C7, leds and led trigger for ath10k

2015-01-16 Thread John Crispin


On 16/01/2015 19:57, Gianluca Anzolin wrote:
 Hi,
 
 I noticed that on Archer C7 the 2.4Ghz and 5Ghz leds are swapped:
 this is the relevant section of /etc/config/system
 
 config led 'led_wlan2g' option name 'WLAN2G' option sysfs
 'tp-link:blue:wlan2g' option trigger 'phy0tpt'
 
 config led 'led_wlan5g' option name 'WLAN5G' option sysfs
 'tp-link:blue:wlan5g' option trigger 'phy1tpt'
 
 However on Archer C7 the 5G interface is on phy0 and 2.4G is on
 phy1.
 
 I've yet to find where (and how) this section is autogenerated but
 I noticed that the phy0pt trigger doesn't even exist on my system.
 

look at

target/linux/ar71xx/base-files/etc/uci-defaults/01_leds



 There is also a bugreport in the bug tracking system pointing at
 this issue: https://dev.openwrt.org/ticket/18188
 
 I looked at the ath9k implementation and I've come up with the
 attached patch.
 
 Do you think a patch like this is acceptable?
 


it is not


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


Re: [OpenWrt-Devel] [PATCH] ar71xx: add support for TP-LINK TL-WA701ND v2

2015-01-16 Thread John Crispin


On 16/01/2015 13:04, Luigi Tarenga wrote:
 Signed-off-by: Luigi Tarenga luigi.tare...@gmail.com
 ---
 I send the patch again, maybe it was not formatted correctly.
 please let me know if there is any problem in how i send it.
 
 regards
 Luigi
 ---
  package/libs/openssl/Makefile |  6 +++---
  package/libs/openssl/patches/150-no_engines.patch | 18 +-
  package/libs/openssl/patches/200-parallel_build.patch |  8 
  package/network/ipv6/map/Makefile |  7 ---
  package/network/ipv6/map/files/map.sh |  3 +++
  package/network/ipv6/map/src/mapcalc.c|  6 --
  6 files changed, 27 insertions(+), 21 deletions(-)
 


the diffstat is from a different patch



 diff --git a/target/linux/ar71xx/base-files/etc/diag.sh
 b/target/linux/ar71xx/base-files/etc/diag.sh
 index fa07f39..eb96338 100755
 --- a/target/linux/ar71xx/base-files/etc/diag.sh
 +++ b/target/linux/ar71xx/base-files/etc/diag.sh
 @@ -195,6 +195,7 @@ get_status_led() {
  tl-mr3220-v2 | \
  tl-mr3420 | \
  tl-mr3420-v2 | \
 +tl-wa701nd-v2 | \
  tl-wa801nd-v2 | \
  tl-wa901nd | \
  tl-wa901nd-v2 | \
 diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 index 5b9dbe7..51c2bca 100755
 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 @@ -275,7 +275,11 @@ tl-wa850re)
  ucidef_set_led_rssi rssihigh RSSIHIGH tp-link:blue:signal5
 wlan0 80 100 -79 13
  ;;
 
 -tl-wa860re)
 +tl-wa701nd-v2 | \
 +tl-wa830re-v2 | \
 +tl-wa860re | \
 +tl-wa801nd-v2 | \
 +tl-wa901nd-v3)
  ucidef_set_led_netdev lan LAN tp-link:green:lan eth0
  ucidef_set_led_wlan wlan WLAN tp-link:green:wlan phy0tpt
  ;;
 @@ -333,11 +337,6 @@ tl-wr841n-v8)
  ucidef_set_led_wlan wlan WLAN tp-link:green:wlan phy0tpt
  ;;
 
 -tl-wa830re-v2)
 -ucidef_set_led_netdev lan LAN tp-link:green:lan eth0
 -ucidef_set_led_wlan wlan WLAN tp-link:green:wlan phy0tpt
 -;;
 -
  tl-wr841n-v9)
  ucidef_set_led_netdev wan WAN tp-link:green:wan eth1
  ucidef_set_led_switch lan1 LAN1 tp-link:green:lan1 switch0 0x10
 @@ -357,12 +356,6 @@ tl-wr842n-v2)
  ucidef_set_led_usbdev usb USB tp-link:green:3g 1-1
  ;;
 
 -tl-wa801nd-v2 | \
 -tl-wa901nd-v3)
 -ucidef_set_led_netdev lan LAN tp-link:green:lan eth0
 -ucidef_set_led_wlan wlan WLAN tp-link:green:wlan phy0tpt
 -;;
 -


this refactoring should be in a separate patch.


  tl-wr941nd | \
  tl-wr1041n-v2)
  ucidef_set_led_wlan wlan WLAN tp-link:green:wlan phy0tpt
 diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 index c5cfd67..4be30b8 100755
 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 @@ -301,6 +301,7 @@ tl-mr13u |\
  tl-mr3020 |\
  tl-mr3040 |\
  tl-mr3040-v2 |\
 +tl-wa701nd-v2 |\
  tl-wa750re |\
  tl-wa850re |\
  tl-wa830re-v2 |\
 diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh
 b/target/linux/ar71xx/base-files/lib/ar71xx.sh
 index 1e96b6d..df35775 100755
 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
 +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
 @@ -571,6 +571,9 @@ ar71xx_board_detect() {
  *TL-MR3420 v2)
  name=tl-mr3420-v2
  ;;
 +*TL-WA701ND v2)
 +name=tl-wa701nd-v2
 +;;
  *TL-WA750RE)
  name=tl-wa750re
  ;;
 diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 index 846954c..eeaac6a 100755
 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 @@ -269,6 +269,7 @@ platform_check_image() {
  tl-mr3220-v2 | \
  tl-mr3420 | \
  tl-mr3420-v2 | \
 +tl-wa701nd-v2 | \
  tl-wa7510n | \
  tl-wa750re | \
  tl-wa850re | \
 diff --git a/target/linux/ar71xx/config-3.10 b/target/linux/ar71xx/config-3.10
 index 9a8378a..482914a 100644
 --- a/target/linux/ar71xx/config-3.10
 +++ b/target/linux/ar71xx/config-3.10
 @@ -88,6 +88,7 @@ CONFIG_ATH79_MACH_TL_MR11U=y
  CONFIG_ATH79_MACH_TL_MR13U=y
  CONFIG_ATH79_MACH_TL_MR3020=y
  CONFIG_ATH79_MACH_TL_MR3X20=y
 +CONFIG_ATH79_MACH_TL_WA701ND_V2=y
  CONFIG_ATH79_MACH_TL_WA830RE_V2=y
  CONFIG_ATH79_MACH_TL_WA901ND=y
  CONFIG_ATH79_MACH_TL_WA901ND_V2=y
 diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa701nd-v2.c
 b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa701nd-v2.c
 new file mode 100644
 index 000..aab92b3
 --- /dev/null
 +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa701nd-v2.c
 @@ -0,0 +1,116 @@
 +/*
 + *  TP-LINK TL-WA701ND v2 board support
 + *
 + *  Copyright (C) 2015 Luigi Tarenga luigi.tare...@gmail.com
 + *
 + *  This program is 

Re: [OpenWrt-Devel] [PATCH] ramips: add support for Intenso Memory 2 Move USB 3.0

2015-01-16 Thread John Crispin


On 15/01/2015 22:47, Christian Lamparter wrote:
 This adds support for a rt5350-based portable nas solution
 from Intenso. The board comes with 32M RAM and 8M Flash, the
 built-in HDD is connected/accessible via a usb3.0-sata
 bridge VLI VL701.
 

[]

 diff --git a/target/linux/ramips/rt305x/profiles/m2m.mk 
 b/target/linux/ramips/rt305x/profiles/m2m.mk
 new file mode 100644
 index 000..e5cb6b8
 --- /dev/null
 +++ b/target/linux/ramips/rt305x/profiles/m2m.mk
 @@ -0,0 +1,20 @@
 +#
 +# Copyright (C) 2015 OpenWrt.org
 +#
 +# This is free software, licensed under the GNU General Public License v2.
 +# See /LICENSE for more information.
 +#
 +
 +define Profile/M2M
 + NAME:=Intenso Memory 2 Move
 + PACKAGES:=\
 + kmod-ledtrig-netdev kmod-ledtrig-timer kmod-leds-gpio \
 + kmod-usb-core kmod-usb2 kmod-usb-storage kmod-scsi-core \
 + kmod-fs-ext4 kmod-fs-vfat block-mount
 +endef
 +

not sure about the filesystem selection. what filesystem is on the disc
when it is shipped ?



 +define Profile/M2M/Description
 + Package set for Intenso Memory 2 Move USB 3.0
 +endef
 +
 +$(eval $(call Profile,M2M))
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] [ar71xx] Add support for MERCURY MAC1200R

2015-01-16 Thread John Crispin


On 11/01/2015 12:48, open...@rogerpueyo.com wrote:
 From: Roger Pueyo Centelles roger.pu...@guifi.net
 

description and SoB are missing




 ---
  target/linux/ar71xx/base-files/etc/diag.sh |   3 +
  .../ar71xx/base-files/etc/uci-defaults/01_leds |   5 +
  .../ar71xx/base-files/etc/uci-defaults/02_network  |   1 +
  target/linux/ar71xx/base-files/lib/ar71xx.sh   |   6 +
  .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
  target/linux/ar71xx/config-3.14|   1 +
  .../files/arch/mips/ath79/mach-mc-mac1200r.c   | 157 
 +
  target/linux/ar71xx/generic/profiles/mercury.mk|  17 +++
  target/linux/ar71xx/image/Makefile |   1 +
  .../736-MIPS-ath79-add-MC-MAC1200R-support.patch   |  39 +
  10 files changed, 231 insertions(+)
  create mode 100644 
 target/linux/ar71xx/files/arch/mips/ath79/mach-mc-mac1200r.c
  create mode 100644 target/linux/ar71xx/generic/profiles/mercury.mk
  create mode 100644 
 target/linux/ar71xx/patches-3.14/736-MIPS-ath79-add-MC-MAC1200R-support.patch
 
 diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
 b/target/linux/ar71xx/base-files/etc/diag.sh
 index 06b96a3..388727f 100755
 --- a/target/linux/ar71xx/base-files/etc/diag.sh
 +++ b/target/linux/ar71xx/base-files/etc/diag.sh
 @@ -105,6 +105,9 @@ get_status_led() {
   ls-sr71)
   status_led=ubnt:green:d22
   ;;
 + mc-mac1200r)
 + status_led=mercury:green:system
 + ;;
   mr600)
   status_led=mr600:orange:power
   ;;
 diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 
 b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 index 296ea57..dc5dfa1 100755
 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 @@ -166,6 +166,11 @@ hornet-ub)
   ucidef_set_led_usbdev usb USB alfa:blue:usb 1-1
   ;;
  
 +mc-mac1200r)
 + ucidef_set_led_wlan wlan2g WLAN2G mercury:green:wlan2g phy1tpt
 + ucidef_set_led_wlan wlan5g WLAN5G mercury:green:wlan5g phy0tpt
 + ;;
 +
  mr600)
   ucidef_set_led_wlan wlan58 WLAN58 mr600:green:wlan58 phy0tpt
   ;;
 diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
 b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 index b4b6cb3..8151470 100755
 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 @@ -367,6 +367,7 @@ dir-615-e1 |\
  dir-615-e4 |\
  hiwifi-hc6361 |\
  ja76pf |\
 +mc-mac1200r|\
  mynet-n600 |\
  oolite |\
  qihoo-c301 |\
 diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
 b/target/linux/ar71xx/base-files/lib/ar71xx.sh
 index 9b056e9..3ce63aa 100755
 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
 +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
 @@ -97,6 +97,9 @@ tplink_board_detect() {
   015300*)
   model=EasyLink EL-MINI
   ;;
 + 12*)
 + model=MERCURY MAC1200R
 + ;;
   3C0001*)
   model=OOLITE
   ;;
 @@ -432,6 +435,9 @@ ar71xx_board_detect() {
   *LS-SR71)
   name=ls-sr71
   ;;
 + *MAC1200R)
 + name=mc-mac1200r
 + ;;
   *MR600v2)
   name=mr600v2
   ;;
 diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
 b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 index 6dabf4e..7153614 100755
 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 @@ -297,6 +297,7 @@ platform_check_image() {
   el-m150 | \
   el-mini | \
   gl-inet | \
 + mc-mac1200r | \
   oolite | \
   smart-300 | \
   tl-mr10u | \
 diff --git a/target/linux/ar71xx/config-3.14 b/target/linux/ar71xx/config-3.14
 index b6fa4ab..a99c082 100644
 --- a/target/linux/ar71xx/config-3.14
 +++ b/target/linux/ar71xx/config-3.14
 @@ -64,6 +64,7 @@ CONFIG_ATH79_MACH_HIWIFI_HC6361=y
  CONFIG_ATH79_MACH_HORNET_UB=y
  CONFIG_ATH79_MACH_JA76PF=y
  CONFIG_ATH79_MACH_JWAP003=y
 +CONFIG_ATH79_MACH_MC_MAC1200R=y
  CONFIG_ATH79_MACH_MR600=y
  CONFIG_ATH79_MACH_MR900=y
  CONFIG_ATH79_MACH_MYNET_N600=y
 diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mc-mac1200r.c 
 b/target/linux/ar71xx/files/arch/mips/ath79/mach-mc-mac1200r.c
 new file mode 100644
 index 000..6b92b9c
 --- /dev/null
 +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mc-mac1200r.c
 @@ -0,0 +1,157 @@
 +/*
 + *  MERCURY MAC1200R board support
 + *
 + *  Copyright (C) 2012 Gabor Juhos juh...@openwrt.org
 + *  Copyright (C) 2013 Gui Iribarren g...@altermundi.net
 + *
 + *  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.
 + */
 +
 

Re: [OpenWrt-Devel] [PATCH] comgt: Allow using non-TTY devices

2015-01-16 Thread John Crispin


On 13/01/2015 18:00, Matti Laakso wrote:
 Some Huawei mobile broadband sticks utilizing the NCM protocol expose
 the control channel as a cdc-wdm device node instead of a virtual TTY.
 This device node does not support the terminal ioctls. This patch
 adds a check whether the provided device is a TTY or not and does not
 attempt to use the terminal ioctls if they are not supported.
 
 Signed-off-by: Matti Laakso malaa...@elisanet.fi
 ---
 diff --git a/package/network/utils/comgt/patches/004-check_tty.patch 
 b/package/network/utils/comgt/patches/004-check_tty.patch
 new file mode 100644
 index 000..d269bce
 --- /dev/null
 +++ b/package/network/utils/comgt/patches/004-check_tty.patch
 @@ -0,0 +1,177 @@
 +--- a/comgt.c
  b/comgt.c
 +@@ -91,6 +91,7 @@ unsigned long hstart,hset;
 + char NullString[]={  };
 + BOOL lastcharnl=1; /* Indicate that last char printed from getonebyte
 +was a nl, so no new one is needed */
 ++BOOL tty=1;
 + 
 + 
 + //open com \/dev/modem\\nset com 38400n81\nset senddelay 0.05\nsend 
 \ATi^m\\nget 2 \ ^m\ $s\nprint \Response : \,$s,\\\n\\nget 2 \ ^m\ 
 $s\nprint \Response :\,$s,\\\n\\nget 2 \ ^m\ $s\nprint \Response : 
 \,$s,\\\n\\n\n;
 +@@ -918,10 +919,12 @@ BOOL getonoroff(void) {
 + }
 + 
 + void setcom(void) {
 +-  stbuf.c_cflag = ~(CBAUD | CSIZE | CSTOPB | CLOCAL | PARENB);
 +-  stbuf.c_cflag |= (speed | bits | CREAD | clocal | parity | stopbits );
 +-  if (ioctl(comfd, TCSETA, stbuf)  0) {
 +-serror(Can't ioctl set device,1);
 ++  if (tty) {
 ++stbuf.c_cflag = ~(CBAUD | CSIZE | CSTOPB | CLOCAL | PARENB);
 ++stbuf.c_cflag |= (speed | bits | CREAD | clocal | parity | stopbits );
 ++if (ioctl(comfd, TCSETA, stbuf)  0) {
 ++  serror(Can't ioctl set device,1);
 ++}
 +   }
 + }
 + 
 +@@ -1224,9 +1227,11 @@ void doclose(void) {
 +   if(strcmp(token,hardcom)==0) {
 + if(comfd== -1) serror(Com device not open,1);
 + vmsg(Closing device);
 +-if (ioctl(comfd, TCSETA, svbuf)  0) {
 +-  sprintf(msg,Can't ioctl set device %s.\n,device);
 +-  serror(msg,1);
 ++if (tty) {
 ++  if (ioctl(comfd, TCSETA, svbuf)  0) {
 ++sprintf(msg,Can't ioctl set device %s.\n,device);
 ++serror(msg,1);
 ++  }
 + }


if (tty  (ioctl(comfd, TCSETA, svbuf)  0)) .


i think this pattern would drastically reduce the diffstat




 + close(comfd);
 + comfd= -1;
 +@@ -1266,26 +1271,32 @@ void opengt(void) {
 +   ext(1);
 + }
 +   }
 +-  if (ioctl (comfd, TCGETA, svbuf)  0) {
 +-sprintf(msg,Can't control %s, please try again.\n,device);
 +-serror(msg,1);
 ++  if (isatty (comfd))
 ++tty=1;
 ++  else
 ++tty=0;
 ++  if (tty) {
 ++if (ioctl (comfd, TCGETA, svbuf)  0) {
 ++  sprintf(msg,Can't control %s, please try again.\n,device);
 ++  serror(msg,1);
 ++}
 ++ioctl(comfd, TCGETA, stbuf);
 ++speed=stbuf.c_cflag  CBAUD;
 ++if (high_speed == 0)  strcpy(cspeed,115200);
 ++else strcpy(cspeed,57600);
 ++bits=stbuf.c_cflag  CSIZE;
 ++clocal=stbuf.c_cflag  CLOCAL;
 ++stopbits=stbuf.c_cflag  CSTOPB;
 ++parity=stbuf.c_cflag  (PARENB | PARODD);
 ++stbuf.c_iflag = ~(IGNCR | ICRNL | IUCLC | INPCK | IXON | IXANY | 
 IGNPAR );
 ++stbuf.c_oflag = ~(OPOST | OLCUC | OCRNL | ONLCR | ONLRET);
 ++stbuf.c_lflag = ~(ICANON | ECHO | ECHOE | ECHONL);
 ++stbuf.c_lflag = ~(ECHO | ECHOE);
 ++stbuf.c_cc[VMIN] = 1;
 ++stbuf.c_cc[VTIME] = 0;
 ++stbuf.c_cc[VEOF] = 1;
 +   }
 +   setenv(COMGTDEVICE,device,1);
 +-  ioctl(comfd, TCGETA, stbuf);
 +-  speed=stbuf.c_cflag  CBAUD;
 +-  if (high_speed == 0)  strcpy(cspeed,115200);
 +-  else strcpy(cspeed,57600);
 +-  bits=stbuf.c_cflag  CSIZE;
 +-  clocal=stbuf.c_cflag  CLOCAL;
 +-  stopbits=stbuf.c_cflag  CSTOPB;
 +-  parity=stbuf.c_cflag  (PARENB | PARODD);
 +-  stbuf.c_iflag = ~(IGNCR | ICRNL | IUCLC | INPCK | IXON | IXANY | IGNPAR 
 );
 +-  stbuf.c_oflag = ~(OPOST | OLCUC | OCRNL | ONLCR | ONLRET);
 +-  stbuf.c_lflag = ~(ICANON | ECHO | ECHOE | ECHONL);
 +-  stbuf.c_lflag = ~(ECHO | ECHOE);
 +-  stbuf.c_cc[VMIN] = 1;
 +-  stbuf.c_cc[VTIME] = 0;
 +-  stbuf.c_cc[VEOF] = 1;
 +   setcom();
 +   dormir(20); /* Wait a bit (DTR raise) */
 +   sprintf(msg,Opened %s as FD %d,device,comfd);
 +@@ -1302,45 +1313,50 @@ void opendevice(void) {
 + }
 +   }
 +   else comfd=0;
 +-
 +-  if (ioctl (comfd, TCGETA, svbuf)  0) {
 +-sprintf(msg,Can't ioctl get device %s.\n,device);
 +-serror(msg,1);
 +-  }
 +-  ioctl(comfd, TCGETA, stbuf);
 +-  speed=stbuf.c_cflag  CBAUD;
 +-  switch(speed) {
 +-case B0: strcpy(cspeed,0);break;
 +-case B50: strcpy(cspeed,50);break;
 +-case B75: strcpy(cspeed,75);break;
 +-case B110: strcpy(cspeed,110);break;
 +-case B300: strcpy(cspeed,300);break;
 +-case B600: strcpy(cspeed,600);break;
 +-case B1200: strcpy(cspeed,1200);break;
 +-case B2400: strcpy(cspeed,2400);break;
 +-case B4800: strcpy(cspeed,4800);break;
 +-case