Re: [OpenWrt-Devel] [PATCH] bcm53xx: Add functions to get/release copies of nvram contents.

2015-05-13 Thread Hante Meuleman
Initially I made the free an inline from header file, but it doesn't compile 
out of the box as it needs the definition for kfree and not all c files which 
include this header file had this, as I don't like the inclusion of header 
files from header files I choose to make an implementation in the c file. 

-Original Message-
From: Felix Fietkau [mailto:n...@openwrt.org] 
Sent: dinsdag 12 mei 2015 22:03
To: Hante Meuleman; OpenWrt Development List
Subject: Re: [OpenWrt-Devel] [PATCH] bcm53xx: Add functions to get/release 
copies of nvram contents.

On 2015-05-12 15:10, Hante Meuleman wrote:
> Added two functions to the bcm47xx_nvram module to get and release copies 
> of the complete nvram contents. This can be used by for example brcmfmac 
> to get complete nvram contents which will after some parsing be sent to 
> device.
> 
> Signed-off-by: Hante Meuleman 
> ---
> diff --git 
> a/target/linux/bcm53xx/files/drivers/firmware/broadcom/bcm47xx_nvram.c 
> b/target/linux/bcm53xx/files/drivers/firmware/broadcom/bcm47xx_nvram.c
> index d0055a4..96d2308 100644
> --- a/target/linux/bcm53xx/files/drivers/firmware/broadcom/bcm47xx_nvram.c
> +++ b/target/linux/bcm53xx/files/drivers/firmware/broadcom/bcm47xx_nvram.c
> @@ -222,4 +222,32 @@ int bcm47xx_nvram_gpio_pin(const char *name)
>  }
>  EXPORT_SYMBOL(bcm47xx_nvram_gpio_pin);
>  
> +char *bcm47xx_nvram_get_contents(size_t *nvram_size)
> +{
> +   int err;
> +   char *nvram;
> +
> +   if (!nvram_buf[0]) {
> +   err = nvram_init();
> +   if (err)
> +   return NULL;
> +   }
> +
> +   *nvram_size = nvram_len - sizeof(struct nvram_header);
> +   nvram = vmalloc(*nvram_size);
> +   if (nvram == NULL)
> +   return NULL;
> +   memcpy(nvram, &nvram_buf[sizeof(struct nvram_header)], *nvram_size);
> +
> +   return nvram;
> +}
> +EXPORT_SYMBOL(bcm47xx_nvram_get_contents);
> +
> +void bcm47xx_nvram_release_contents(char *nvram)
> +{
> +   vfree(nvram);
> +}
> +EXPORT_SYMBOL(bcm47xx_nvram_release_contents);
How about making this one inline instead of adding yet another export?

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


[OpenWrt-Devel] [PATCH] ralink: add support for ap699ge8c2

2015-05-13 Thread Cristian Morales Vega
Signed-off-by: Cristian Morales Vega 
---
 .../linux/ramips/base-files/etc/board.d/02_network |   5 +
 target/linux/ramips/base-files/lib/ramips.sh   |   3 +
 .../ramips/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ramips/dts/AP699GE8C2.dts | 112 +
 target/linux/ramips/image/Makefile |   6 +-
 target/linux/ramips/mt7621/profiles/ap699ge8c2.mk  |  18 
 6 files changed, 144 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ramips/dts/AP699GE8C2.dts
 create mode 100644 target/linux/ramips/mt7621/profiles/ap699ge8c2.mk

diff --git a/target/linux/ramips/base-files/etc/board.d/02_network 
b/target/linux/ramips/base-files/etc/board.d/02_network
index 24e1ba8..ee6aab0 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -116,6 +116,7 @@ ramips_setup_interfaces()
;;
 
3g-6200n | \
+   ap699ge8c2 | \
ai-br100 | \
dir-610-a1 | \
dir-300-b7 | \
@@ -268,6 +269,10 @@ ramips_setup_macs()
local wan_mac=""
 
case $board in
+   ap699ge8c2)
+   wan_mac=$(mtd_get_mac_binary factory 57350)
+   ;;
+
br-6475nd)
lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(mtd_get_mac_binary devdata 7)
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index 616f4a1..c1b7898 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -397,6 +397,9 @@ ramips_board_detect() {
*"Mediatek MT7628AN evaluation board")
name="mt7628"
;;
+   *"TWSZ AP699GE8C2")
+   name="ap699ge8c2"
+   ;;
*)
name="generic"
;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 17b456b..b79cca8 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -25,6 +25,7 @@ platform_check_image() {
all0256n | \
all5002 | \
all5003 | \
+   ap699ge8c2 | \
ar725w | \
asl26555 | \
awapn2403 | \
diff --git a/target/linux/ramips/dts/AP699GE8C2.dts 
b/target/linux/ramips/dts/AP699GE8C2.dts
new file mode 100644
index 000..c7266bb
--- /dev/null
+++ b/target/linux/ramips/dts/AP699GE8C2.dts
@@ -0,0 +1,112 @@
+/dts-v1/;
+
+/include/ "mt7621.dtsi"
+
+/ {
+   compatible = "mediatek,mt7621-eval-board", "mediatek,mt7621-soc";
+   model = "TWSZ AP699GE8C2";
+
+   memory@0 {
+   device_type = "memory";
+   reg = <0x0 0x400>;
+   };
+
+   chosen {
+   bootargs = "console=ttyS0,57600";
+   };
+
+   palmbus@1E00 {
+   spi@b00 {
+   status = "okay";
+
+   m25p80@0 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "mx25l6405d";
+   reg = <0 0>;
+   linux,modalias = "m25p80";
+   spi-max-frequency = <1000>;
+
+   partition@0 {
+   label = "u-boot";
+   reg = <0x0 0x3>;
+   read-only;
+   };
+
+   partition@3 {
+   label = "u-boot-env";
+   reg = <0x3 0x1>;
+   read-only;
+   };
+
+   factory: partition@4 {
+   label = "factory";
+   reg = <0x4 0x1>;
+   read-only;
+   };
+
+   partition@5 {
+   label = "firmware";
+   reg = <0x5 0x7b>;
+   };
+
+   };
+   };
+   };
+
+   pcie@1e14 {
+   status = "okay";
+
+   pcie0 {
+   mt76@0,0 {
+   reg = <0x 0 0 0 0>;
+   device_type = "pci";
+   mediatek,mtd-eeprom = <&factory 0x8000>;
+   mediatek,2ghz = <0>;
+   };
+   };
+
+   pcie1 {
+   mt76@1,0 {
+   reg = <0x 0 0 0 0>;
+  

Re: [OpenWrt-Devel] WAN dhcp client doesnt recognize unplugged cable and doesnt request new IP on replugged

2015-05-13 Thread Conor O'Gorman

On 12/05/15 17:57, Jakub Jančo wrote:

Hello,

I have tplink 1043nd with BB

Problem is that I have dhcp client on WAN and if I unplug cable from
WAN, it doesnt change status, give up dhcp address.

Even worse is that if I plug cable with another end point with another
network, WAN dhcp client doesnt  pull new IP, I must click on "Connect"
to refresh dhcp client, then new ip is assigned and internet works. Or
restart device.


Have a look at ifpugd.

But maybe netifd should/could/might do something for this scenario?

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


[OpenWrt-Devel] regarding patch "lldpd: update to version 0.7.14"

2015-05-13 Thread Alexandru Ardelean
Hello,

I don't have the original email, hence this one.

Is there a conclusion for this patch : "lldpd: update to version 0.7.14"
http://patchwork.ozlabs.org/patch/463177/ ?

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


[OpenWrt-Devel] [PATCH 2/3] rpcd, iwinfo: add support for vendor_elements

2015-05-13 Thread Roman Yeryomin
Signed-off-by: Roman Yeryomin 
---
 iwinfo.c | 41 -
 1 file changed, 40 insertions(+), 1 deletion(-)

diff --git a/iwinfo.c b/iwinfo.c
index 325c07a..6e34ea1 100644
--- a/iwinfo.c
+++ b/iwinfo.c
@@ -317,6 +317,41 @@ rpc_iwinfo_info(struct ubus_context *ctx, struct 
ubus_object *obj,
return UBUS_STATUS_OK;
 }
 
+static void
+rpc_iwinfo_add_ve(const char *name, struct iwinfo_scanlist_entry *e)
+{
+   void *c, *d;
+   char oui[7];
+   char *data = NULL;
+   int datalen, i, di;
+
+   d = blobmsg_open_array(&buf, name);
+   for (i = 0; i < IWINFO_VE_MAX; i++) {
+   if (e->ve[i].len < 1)
+   break;
+   c = blobmsg_open_table(&buf, NULL);
+
+   snprintf(oui, sizeof(oui), "%02x%02x%02x", e->ve[i].oui[0],
+  e->ve[i].oui[1],
+  e->ve[i].oui[2]);
+   blobmsg_add_string(&buf, "oui", oui);
+
+   datalen = e->ve[i].len * 2;
+   data = (char *)malloc(datalen + 1);
+   if (!data) {
+   blobmsg_close_table(&buf, c);
+   break;
+   }
+   for (di = 0; di < e->ve[i].len - sizeof(e->ve[i].oui); di++)
+   snprintf(data + di * 2, 3, "%02x", e->ve[i].data[di]);
+   blobmsg_add_string(&buf, "data", data);
+   free(data);
+
+   blobmsg_close_table(&buf, c);
+   }
+   blobmsg_close_array(&buf, d);
+}
+
 static int
 rpc_iwinfo_scan(struct ubus_context *ctx, struct ubus_object *obj,
 struct ubus_request_data *req, const char *method,
@@ -325,7 +360,7 @@ rpc_iwinfo_scan(struct ubus_context *ctx, struct 
ubus_object *obj,
int i, rv, len;
void *c, *d;
char mac[18];
-   char res[IWINFO_BUFSIZE];
+   char res[IWINFO_MAX_APS * sizeof(struct iwinfo_scanlist_entry)];
struct iwinfo_scanlist_entry *e;
 
rv = rpc_iwinfo_open(msg);
@@ -363,6 +398,10 @@ rpc_iwinfo_scan(struct ubus_context *ctx, struct 
ubus_object *obj,
 
rpc_iwinfo_add_encryption("encryption", &e->crypto);
 
+   /* add vendor elements if exist */
+   if (e->ve[0].len)
+   rpc_iwinfo_add_ve("vendor_elements", e);
+
blobmsg_close_table(&buf, d);
}
}
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/3] iwinfo, nl80211: add support for vendor_elements

2015-05-13 Thread Roman Yeryomin
Signed-off-by: Roman Yeryomin 
---
 include/iwinfo.h | 9 +
 iwinfo_cli.c | 2 +-
 iwinfo_nl80211.c | 7 +++
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/include/iwinfo.h b/include/iwinfo.h
index 95020a4..856525e 100644
--- a/include/iwinfo.h
+++ b/include/iwinfo.h
@@ -21,7 +21,9 @@
 
 
 #define IWINFO_BUFSIZE 24 * 1024
+#define IWINFO_MAX_APS 100
 #define IWINFO_ESSID_MAX_SIZE  32
+#define IWINFO_VE_MAX  10
 
 #define IWINFO_80211_A   (1 << 0)
 #define IWINFO_80211_B   (1 << 1)
@@ -119,6 +121,12 @@ struct iwinfo_crypto_entry {
uint8_t auth_algs;
 };
 
+struct iwinfo_ve_entry {
+   uint8_t len;
+   uint8_t oui[3];
+   uint8_t data[255];
+};
+
 struct iwinfo_scanlist_entry {
uint8_t mac[6];
uint8_t ssid[IWINFO_ESSID_MAX_SIZE+1];
@@ -128,6 +136,7 @@ struct iwinfo_scanlist_entry {
uint8_t quality;
uint8_t quality_max;
struct iwinfo_crypto_entry crypto;
+   struct iwinfo_ve_entry ve[IWINFO_VE_MAX];
 };
 
 struct iwinfo_country_entry {
diff --git a/iwinfo_cli.c b/iwinfo_cli.c
index ed6be54..85f232a 100644
--- a/iwinfo_cli.c
+++ b/iwinfo_cli.c
@@ -565,7 +565,7 @@ static void print_info(const struct iwinfo_ops *iw, const 
char *ifname)
 static void print_scanlist(const struct iwinfo_ops *iw, const char *ifname)
 {
int i, x, len;
-   char buf[IWINFO_BUFSIZE];
+   char buf[IWINFO_MAX_APS * sizeof(struct iwinfo_scanlist_entry)];
struct iwinfo_scanlist_entry *e;
 
if (iw->scanlist(ifname, buf, &len))
diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c
index efc58e6..8c595cd 100644
--- a/iwinfo_nl80211.c
+++ b/iwinfo_nl80211.c
@@ -1859,6 +1859,7 @@ static void nl80211_get_scanlist_ie(struct nlattr **bss,
unsigned char *ie = nla_data(bss[NL80211_BSS_INFORMATION_ELEMENTS]);
static unsigned char ms_oui[3] = { 0x00, 0x50, 0xf2 };
int len;
+   int vei = 0;
 
while (ielen >= 2 && ielen >= ie[1])
{
@@ -1876,6 +1877,12 @@ static void nl80211_get_scanlist_ie(struct nlattr **bss,
break;
 
case 221: /* Vendor */
+   if (ie[1] >= 4 && vei < IWINFO_VE_MAX) {
+   e->ve[vei].len = ie[1];
+   memcpy(e->ve[vei].oui, ie + 2, 3);
+   memcpy(e->ve[vei].data, ie + 5, ie[1] - 3);
+   vei++;
+   }
if (ie[1] >= 4 && !memcmp(ie + 2, ms_oui, 3) && ie[5] 
== 1)
iwinfo_parse_rsn(&e->crypto, ie + 6, ie[1] - 4,
 IWINFO_CIPHER_TKIP, 
IWINFO_KMGMT_PSK);
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/3] hostapd: allow to set vendor_elements via /etc/config/wireless

2015-05-13 Thread Roman Yeryomin
Signed-off-by: Roman Yeryomin 
---
 package/network/services/hostapd/files/netifd.sh | 5 +
 1 file changed, 5 insertions(+)

diff --git a/package/network/services/hostapd/files/netifd.sh 
b/package/network/services/hostapd/files/netifd.sh
index 23d2e7e..1d1b098 100644
--- a/package/network/services/hostapd/files/netifd.sh
+++ b/package/network/services/hostapd/files/netifd.sh
@@ -164,6 +164,8 @@ hostapd_common_add_bss_config() {
config_add_int mcast_rate
config_add_array basic_rate
config_add_array supported_rates
+
+   config_add_string 'vendor_elements:string'
 }
 
 hostapd_set_bss_options() {
@@ -437,6 +439,9 @@ hostapd_set_bss_options() {
) > "$_macfile"
}
 
+   json_get_vars vendor_elements
+   [ -n "$vendor_elements" ] && append bss_conf 
"vendor_elements=$vendor_elements" "$N"
+
append "$var" "$bss_conf" "$N"
return 0
 }
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] scripts/feeds: Delete package/feeds folder in the clean procedure to prevent dangling links.

2015-05-13 Thread Martin Strbacka
Hello,

if you run:
./scripts/feeds clean 
It removes ./feeds folder but not ./package/feeds/ which is full of dangling 
links then. This patch fixes it.

Best Regards,
Martin Strba??ka

Signed-off-by: Martin Strbacka 
---
 scripts/feeds | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/feeds b/scripts/feeds
index 89cb5a2..a6be9cc 100755
--- a/scripts/feeds
+++ b/scripts/feeds
@@ -793,7 +793,7 @@ my %commands = (
'uninstall' => \&uninstall,
'feed_config' => \&feed_config,
'clean' => sub {
-   system("rm -rf feeds");
+   system("rm -rf ./feeds ./package/feeds");
}
 );
 
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ramips: Adding support for AXIMCom MR-102N 3G/4G Travel Mobile Router

2015-05-13 Thread Tai-hwa Liang
MR-102N is a RT3050F based wireless router(32M RAM + 8M NOR flash) with 1 USB
and 1 ethernet port.  The original product information can be found at:
http://www.aximcom.com/en/MR-102N

Signed-off-by:  Tai-hwa Liang 
---
 target/linux/ramips/base-files/etc/board.d/01_leds |   4 +
 .../linux/ramips/base-files/etc/board.d/02_network |   3 +-
 target/linux/ramips/base-files/etc/diag.sh |   3 +
 target/linux/ramips/base-files/lib/ramips.sh   |   3 +
 .../ramips/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ramips/dts/MR-102N.dts| 111 +
 target/linux/ramips/image/Makefile |   3 +
 target/linux/ramips/rt305x/profiles/aximcom.mk |  17 
 8 files changed, 144 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ramips/dts/MR-102N.dts
 create mode 100644 target/linux/ramips/rt305x/profiles/aximcom.mk

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds 
b/target/linux/ramips/base-files/etc/board.d/01_leds
index 56ba3b7..f5974f2 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -141,6 +141,10 @@ case $board in
mpr-a2)
set_wifi_led "hame:blue:system"
;;
+   mr-102n)
+   set_wifi_led "mr-102n:green:wlan"
+   set_usb_led "mr-102n:green:usb"
+   ;;
mzk-w300nh2)
set_wifi_led "mzkw300nh2:amber:wlan"
;;
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network 
b/target/linux/ramips/base-files/etc/board.d/02_network
index 24e1ba8..a84ee39 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -61,7 +61,8 @@ ramips_setup_interfaces()
;;
 
3g-6200nl | \
-   mlw221)
+   mlw221 | \
+   mr-102n)
ucidef_set_interface_lan "eth0.2"
;;
mlwg2)
diff --git a/target/linux/ramips/base-files/etc/diag.sh 
b/target/linux/ramips/base-files/etc/diag.sh
index 5301593..5c860a1 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -101,6 +101,9 @@ get_status_led() {
mpr-a2)
status_led="hame:red:power"
;;
+   mr-102n)
+   status_led="mr-102n:amber:status"
+   ;;
nbg-419n)
status_led="nbg-419n:green:power"
;;
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index 616f4a1..02fb426 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -85,6 +85,9 @@ ramips_board_detect() {
*"Aztech HW550-3G")
name="hw550-3g"
;;
+   *"AXIMCom MR-102N")
+   name="mr-102n"
+   ;;
*"Buffalo WSR-600DHP")
name="wsr-600"
;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 17b456b..ee81803 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -66,6 +66,7 @@ platform_check_image() {
mofi3500-3gn | \
mpr-a1 | \
mpr-a2 | \
+   mr-102n | \
mzk-w300nh2 | \
nbg-419n | \
nw718 | \
diff --git a/target/linux/ramips/dts/MR-102N.dts 
b/target/linux/ramips/dts/MR-102N.dts
new file mode 100644
index 000..c2a6e24
--- /dev/null
+++ b/target/linux/ramips/dts/MR-102N.dts
@@ -0,0 +1,111 @@
+/dts-v1/;
+
+/include/ "rt3050.dtsi"
+
+/ {
+   compatible = "MR-102N", "ralink,rt3052-soc";
+   model = "AXIMCom MR-102N";
+
+   pinctrl {
+   state_default: pinctrl0 {
+   gpio {
+   ralink,group = "i2c", "jtag", "rgmii", "mdio", 
"uartf";
+   ralink,function = "gpio";
+   };
+   };
+   };
+
+   cfi@1f00 {
+   compatible = "cfi-flash";
+   reg = <0x1f00 0x80>;
+
+   bank-width = <2>;
+   device-width = <2>;
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   partition@0 {
+   label = "u-boot";
+   reg = <0x0 0x3>;
+   read-only;
+   };
+
+   partition@3 {
+   label = "u-boot-env";
+   reg = <0x3 0x1>;
+   read-only;
+   };
+
+   factory: partition@4 {
+   label = "factory";
+   reg = <0x4 0x1>;
+   read-only;
+   };
+
+   partition@5 {
+  

[OpenWrt-Devel] [RFC] [PATCH] build: honor command line CONFIG_ variables on kernel_*config targets

2015-05-13 Thread Emmanuel Deloget
The CONFIG_* variables are correctly handled when building nearly all
targets (at least packages and full build) yet they are not honored on
kernel_menuconfig and similar targets.

Some use case :

  make CONFIG_DOWNLOAD_FOLDER=../dl/ kernel_menuconfig
  make CONFIG_BUILD_SUFFIX=test kernel_oldconfig

and so on...

When used, they generate build errors because the kernel_*config targets
are not able to find the correct directories.

Signed-off-by: Emmanuel Deloget 
---
 include/toplevel.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/toplevel.mk b/include/toplevel.mk
index d8651d9..02e337a 100644
--- a/include/toplevel.mk
+++ b/include/toplevel.mk
@@ -128,13 +128,13 @@ else
 endif

 kernel_oldconfig: prepare_kernel_conf
- $(_SINGLE)$(NO_TRACE_MAKE) -C target/linux oldconfig
+ $(_SINGLE)$(NO_TRACE_MAKE) $(filter CONFIG_%,$(MAKEFLAGS)) -C
target/linux oldconfig

 kernel_menuconfig: prepare_kernel_conf
- $(_SINGLE)$(NO_TRACE_MAKE) -C target/linux menuconfig
+ $(_SINGLE)$(NO_TRACE_MAKE) $(filter CONFIG_%,$(MAKEFLAGS)) -C
target/linux menuconfig

 kernel_nconfig: prepare_kernel_conf
- $(_SINGLE)$(NO_TRACE_MAKE) -C target/linux nconfig
+ $(_SINGLE)$(NO_TRACE_MAKE) $(filter CONFIG_%,$(MAKEFLAGS)) -C
target/linux nconfig

 staging_dir/host/.prereq-build: include/prereq-build.mk
  mkdir -p tmp
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] External (public) IP forwarded to internal LAN

2015-05-13 Thread Angelo Corsaro

Hi all,
first of all, I'm sorry for my poor english and if I placed my question 
in a wrong place.
I'm facing an issue with,I think, iptables. This is the scenario: I'm 
using a ddns service to point my external ip to access my server; and it 
works fine, but the original address is always  the internal iface of my 
modem.


This is my actual port-forwarding conf in /etc/config/firewall

config redirect
option target 'DNAT'
option src 'wan'
option dest 'lan'
option proto 'tcp udp'
option dest_ip '192.168.x.x'
option dest_port 'x'
option name 'Photo'
option src_dport 'x'
option reflection '1'


surfing on web and in the wiki of openwrt I cannot find any solution.
If I'm not wrong, in the previous release of openwrt the origin's IP was 
forwarded to the internal lan.

Tcpdumping the wan iface I can see both public ip (original and my own ip)

Is there any solution (conf, recompile the packet,patch etc) to reflect 
the previous behaviour ?


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


Re: [OpenWrt-Devel] [PATCH] Vlan configuration, limit the used ports

2015-05-13 Thread Rafał Miłecki
On 12 May 2015 at 10:16, Hante Meuleman  wrote:
> Do not mimic the vlan configuration in some devices like R8000 as the
> configuration is to be used with SW accelerators not available in OpenWRT.
> It is not possible to use the switch with vlan port configuration 0 1 2 3 5 7 
> 8,
> without making some huge modifications. When this configuration is used
> the packets received will be without vlan tag (identified by status field in
> gmac). This mode is used for an optimization which is not easily to be used
> within the current OpenWRT driver framework.

I think I fixed it now, with indeed few modifications, but not that
huge ones after all. If you could test latest OpenWrt trunk/master it
would be great.


> The patch below will modify the existing vlanport configuration so it will 
> work
> on the r8000 with the existing opensource drivers.

The problem with this patch (apart from S-o-b) was the silent way of
handling R8000. You dropped code that recognized R8000 specific config
just silently falling back to the default one. It would be much safer
to leave R8000 case detection, just change the vlans config and add a
proper comment. Just for the future :)
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] include/scan.mk: Add -a argument to the grep to treat all Makefiles as a text file.

2015-05-13 Thread Martin Strbacka
Hello,

I found out that in some rare cases grep can treat Makefile as a binary file. 
That happened to me on UTF-8 Gentoo if Makefile contained a character which was 
from extended ASCII table. 
Without this patch the output of the grep command in the $(FILELIST) target is 
not valid (contains line "Binary file matches") and following commands fail to 
create feed index file.

Best Regards,
Martin Strbacka

Signed-off-by: Martin Strbacka 
---
 include/scan.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/scan.mk b/include/scan.mk
index c2a8f7e..5af0359 100644
--- a/include/scan.mk
+++ b/include/scan.mk
@@ -55,7 +55,7 @@ endif
 
 $(FILELIST): $(OVERRIDELIST)
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 
$(GREP_STRING)' | sed -e 's#^$(SCAN_DIR)/##' -e 's#/Makefile:.*##' | uniq | awk 
-v of=$(OVERRIDELIST) -f include/scan.awk > $@
+   $(call FIND_L, $(SCAN_DIR)) $(SCAN_EXTRA) -mindepth 1 $(if 
$(SCAN_DEPTH),-maxdepth $(SCAN_DEPTH)) -name Makefile | xargs grep -aHE 'call 
$(GREP_STRING)' | sed -e 's#^$(SCAN_DIR)/##' -e 's#/Makefile:.*##' | uniq | awk 
-v of=$(OVERRIDELIST) -f include/scan.awk > $@
 
 $(TMP_DIR)/info/.files-$(SCAN_TARGET).mk: $(FILELIST)
( \
-- 
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] bcm53xx: Add functions to get/release copies of nvram contents.

2015-05-13 Thread Felix Fietkau
On 2015-05-13 09:48, Hante Meuleman wrote:
> Initially I made the free an inline from header file, but it doesn't compile 
> out of the box as it needs the definition for kfree and not all c files which 
> include this header file had this, as I don't like the inclusion of header 
> files from header files I choose to make an implementation in the c file. 
I don't understand your reasons at all. How does it make more sense to
make the code more bloated instead of placing a simple #include
statement (which doesn't cost anything)?

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


[OpenWrt-Devel] procd: "failed to symlink /tmp -> /var" - creation of this symlink in procd needed?

2015-05-13 Thread Heiner Kallweit
Recently the system log started to report a warning "failed to symlink /tmp -> 
/var".
This symlink is part of the base-files package and later procd tries to do the 
same
in early.c. As the symlink is already there this fails and throws the warning.
Until few weeks ago this failed silently, on Mar 28th 2015 the warning was 
introduced.

My question: Do we need to create this symlink in procd at all as it's part of 
base-files already?

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


Re: [OpenWrt-Devel] [PATCH] bcm53xx: Add functions to get/release copies of nvram contents.

2015-05-13 Thread Rafał Miłecki
On 13 May 2015 at 18:45, Felix Fietkau  wrote:
> On 2015-05-13 09:48, Hante Meuleman wrote:
>> Initially I made the free an inline from header file, but it doesn't compile
>> out of the box as it needs the definition for kfree and not all c files which
>> include this header file had this, as I don't like the inclusion of header
>> files from header files I choose to make an implementation in the c file.
> I don't understand your reasons at all. How does it make more sense to
> make the code more bloated instead of placing a simple #include
> statement (which doesn't cost anything)?

I agree with Felix, I don't think there is anything forbidden about
including header in a header :)

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


Re: [OpenWrt-Devel] [PATCH] bcm53xx: Add functions to get/release copies of nvram contents.

2015-05-13 Thread Felix Fietkau
On 2015-05-13 20:14, Hante Meuleman wrote:
> Bloated? Seriously? Putting the lines in either C or H and either have an 
> additional include or a prototype (both 1 line). 
Having the function in the .c file along with the EXPORT_SYMBOL makes
the kernel size bigger. Including the header file with an inline
function doesn't.

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


[OpenWrt-Devel] Question on compiling a wifi driver getting: CONFIG_CFG80211 nor CONFIG_CFG80211_MODULE is defined in kernel

2015-05-13 Thread Derek Werthmuller
I'm trying to compile a vendor open source driver under the latest trunk.
My package Makefile has
DEPENDS:= +wireless-tools @USB_SUPPORT +kmod-cfg80211 +kmod-mac80211 but
I'm still getting this CONFIG_CFG80211 nor CONFIG_CFG80211_MODULE is
defined in kernel.

Looking into the .config file I don't see CFG80211 listed anywhere.  I
suspect since the cfg80211 is compiled as a module it doesn't show up in
.config and therefore the build process doesn't see the cfg80211 components
it needs. What is the recommended method to make the cfg80211 components
available so the driver build process can find it?   Is it via
TARGET_CPPFLAGS and the like?  Are there other drivers that are built that
need to reference the cfg80211 files in this way?

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


Re: [OpenWrt-Devel] External (public) IP forwarded to internal LAN

2015-05-13 Thread Lars Kruse
Hi Angelo,


> I'm facing an issue with,I think, iptables. This is the scenario: I'm 
> using a ddns service to point my external ip to access my server; and it 
> works fine, but the original address is always  the internal iface of my 
> modem.

I am not sure what is the source and the destination of your requests and
where you noticed an unexpected IP (and what your expectation was).

I guess that the complete firewall configuration is also necessary for analyzing
this problem. Additionally the output of the following commands would be useful:
 iptables -L -vn
 iptables -t nat -L -vn
(preferably in separate files)

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