Re: [OpenWrt-Devel] "3-address Wi-Fi bridging" (was: Multiple Wi-Fi client/AP interfaces on one radio)
Hi, Basically i will add one switch in GUI to select either 2.4GHz or 5GHz. So if i select 2.4GHz the settings should be like below, *config wifi-device 'wifi0'* * option type 'qcawifi' option channel 'auto' option macaddr '00:03:7f:42:06:61' option hwmode '11ng' option txpower '19' option htmode 'HT20' config wifi-iface option device 'wifi0' option network 'lan' option mode 'ap' option encryption 'psk2' option ssid 'Test_ap_1' option key 'Test_ap_1'* so if i do factory reset it settings. When i select 5GHz the config load with 5GHz as below: *config wifi-device 'wifi0'* * option type 'qcawifi' option channel 'auto' option macaddr '00:03:7f:42:06:61' option hwmode '11na' option txpower '23' option htmode 'HT20' config wifi-iface option device 'wifi0' option network 'lan' option mode 'ap' option encryption 'psk2' option ssid 'Test_ap_1' option key 'Test_ap_1'* *So basically how i can condition in wireless config file to load the config based on the selection.* *Can i write condition in wireless config file.* *Thanks,* On Sun, Aug 9, 2015 at 7:02 AM, David Lang wrote: > On Sat, 8 Aug 2015, John kerry wrote: > > Hi, >> >> I have to keep 2 default settings for wireless, i means to say i have to >> configure default settings for 2.4GHz and 5GHz. >> >> How i can configure wireless files. mainly i will add switch button in the >> GUI to switch over 2.4GHz and 5GHz. >> >> How i can control this in backend, how i can add file which handle this >> and >> configure 2 separate default settings for 2.4GHz and 5GHz. >> > > It's not clear what you are asking to do. Please explain in more detail. > > David Lang > > > Thanks, >> >> On Fri, Aug 7, 2015 at 1:50 PM, David Lang wrote: >> >> You cannot use both radios on the same channel, or even the same band. >>> >>> One radio will only work on channels 1-11 and the other will only work on >>> channels 36+ >>> >>> pick which band you are going to use to connect to the remote AP and >>> which >>> you are going to use to have your clients connect to it. >>> >>> David Lang >>> >>> >>> On Fri, 7 Aug 2015, John kerry wrote: >>> >>> Hi, >>> I have one and i configured as below: config wifi-device 'wifi0' option type 'qcawifi' option channel 'auto' option macaddr '00:26:75:bd:37:24' option hwmode '11ng' option txpower '16' option htmode 'HT20' config wifi-iface option device 'wifi0' option network 'lan' option mode 'ap' option ssid 'Test_Ap' option encryption 'psk2' option key 'Test_AP' We can configure one radio only to work like that. Something like below: config wifi-device 'radio0' option type 'mac80211' > >> option channel '11' >> option hwmode '11g' >> option path 'platform/ar933x_wmac' >> option htmode 'HT20' >> option country 'US' >> option txpower '20' >> >> config wifi-iface 'ap1' >> option device 'radio0' >> option mode 'ap' >> option wds '1' >> option ssid 'my AP' >> option network 'lan' >> >> config wifi-iface 'mesh1' >> option device 'radio0' >> option mode 'mesh' >> option mesh_id 'my mesh' >> option network 'lan' >> >> > On Fri, Aug 7, 2015 at 11:31 AM, Weedy wrote: On 6 Aug 2015 23:15, "John kerry" wrote: > > >> Hi, >> >> >> Could anyone please help me on this to configure the wireless in such >> a >> >> way that when we connect to wireless WAN the LAN SSID should not > change. > > >> >> Thanks, >> >> > You need 2 physical radios. > > > >> ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] Netgear R7000 tester needed (serial console recommended)
Hi, I'll copy my testing requests from OpenWrt forum post [0]: > 2 weeks ago someone on IRC said he has a R7000 with serial console attached > and he wants to try OpenWrt. He provided required info and then I added basic > R7000 support: > https://dev.openwrt.org/changeset/46363/ > > As it often happens, then he disappeared. Image ready to test is available in > snapshots, see: > https://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/ > You just have to install openwrt-bcm53xx-netgear-r7000-squashfs.chk > > After installing it please confirm that it boots & works. Then please tests > GPIOs to provide LEDs and buttons mappings: > http://wiki.openwrt.org/doc/devel/add.new.device#gpios Serial console is recommended in case something goes wrong and OpenWrt won't boot. Bricking device totally is quite unlikely. [0] https://forum.openwrt.org/viewtopic.php?pid=285654#p285654 -- Rafał ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] "3-address Wi-Fi bridging" (was: Multiple Wi-Fi client/AP interfaces on one radio)
On Sat, 8 Aug 2015, John kerry wrote: Hi, I have to keep 2 default settings for wireless, i means to say i have to configure default settings for 2.4GHz and 5GHz. How i can configure wireless files. mainly i will add switch button in the GUI to switch over 2.4GHz and 5GHz. How i can control this in backend, how i can add file which handle this and configure 2 separate default settings for 2.4GHz and 5GHz. It's not clear what you are asking to do. Please explain in more detail. David Lang Thanks, On Fri, Aug 7, 2015 at 1:50 PM, David Lang wrote: You cannot use both radios on the same channel, or even the same band. One radio will only work on channels 1-11 and the other will only work on channels 36+ pick which band you are going to use to connect to the remote AP and which you are going to use to have your clients connect to it. David Lang On Fri, 7 Aug 2015, John kerry wrote: Hi, I have one and i configured as below: config wifi-device 'wifi0' option type 'qcawifi' option channel 'auto' option macaddr '00:26:75:bd:37:24' option hwmode '11ng' option txpower '16' option htmode 'HT20' config wifi-iface option device 'wifi0' option network 'lan' option mode 'ap' option ssid 'Test_Ap' option encryption 'psk2' option key 'Test_AP' We can configure one radio only to work like that. Something like below: config wifi-device 'radio0' option type 'mac80211' option channel '11' option hwmode '11g' option path 'platform/ar933x_wmac' option htmode 'HT20' option country 'US' option txpower '20' config wifi-iface 'ap1' option device 'radio0' option mode 'ap' option wds '1' option ssid 'my AP' option network 'lan' config wifi-iface 'mesh1' option device 'radio0' option mode 'mesh' option mesh_id 'my mesh' option network 'lan' On Fri, Aug 7, 2015 at 11:31 AM, Weedy wrote: On 6 Aug 2015 23:15, "John kerry" wrote: Hi, Could anyone please help me on this to configure the wireless in such a way that when we connect to wireless WAN the LAN SSID should not change. Thanks, You need 2 physical radios. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] "3-address Wi-Fi bridging" (was: Multiple Wi-Fi client/AP interfaces on one radio)
you have two radio settings in /etc/config/wireless, one is for 2.4GHz, one is for 5GHz set each of them the way you want them to be (one as a client to the remote AP, the other as a different SSID for your local users to connect to), then add this file to your build process the way you did /etc/config/networks (under files/) David Lang On Sun, 9 Aug 2015, John kerry wrote: Hi, Could anyone Please guide me how i can create 2 separate default settings for 2.4GHz and 5GHz. Thanks, On Sat, Aug 8, 2015 at 8:26 PM, John kerry wrote: Hi, I have to keep 2 default settings for wireless, i means to say i have to configure default settings for 2.4GHz and 5GHz. How i can configure wireless files. mainly i will add switch button in the GUI to switch over 2.4GHz and 5GHz. How i can control this in backend, how i can add file which handle this and configure 2 separate default settings for 2.4GHz and 5GHz. Thanks, On Fri, Aug 7, 2015 at 1:50 PM, David Lang wrote: You cannot use both radios on the same channel, or even the same band. One radio will only work on channels 1-11 and the other will only work on channels 36+ pick which band you are going to use to connect to the remote AP and which you are going to use to have your clients connect to it. David Lang On Fri, 7 Aug 2015, John kerry wrote: Hi, I have one and i configured as below: config wifi-device 'wifi0' option type 'qcawifi' option channel 'auto' option macaddr '00:26:75:bd:37:24' option hwmode '11ng' option txpower '16' option htmode 'HT20' config wifi-iface option device 'wifi0' option network 'lan' option mode 'ap' option ssid 'Test_Ap' option encryption 'psk2' option key 'Test_AP' We can configure one radio only to work like that. Something like below: config wifi-device 'radio0' option type 'mac80211' option channel '11' option hwmode '11g' option path 'platform/ar933x_wmac' option htmode 'HT20' option country 'US' option txpower '20' config wifi-iface 'ap1' option device 'radio0' option mode 'ap' option wds '1' option ssid 'my AP' option network 'lan' config wifi-iface 'mesh1' option device 'radio0' option mode 'mesh' option mesh_id 'my mesh' option network 'lan' On Fri, Aug 7, 2015 at 11:31 AM, Weedy wrote: On 6 Aug 2015 23:15, "John kerry" wrote: Hi, Could anyone please help me on this to configure the wireless in such a way that when we connect to wireless WAN the LAN SSID should not change. Thanks, You need 2 physical radios. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] "3-address Wi-Fi bridging" (was: Multiple Wi-Fi client/AP interfaces on one radio)
Hi, Could anyone Please guide me how i can create 2 separate default settings for 2.4GHz and 5GHz. Thanks, On Sat, Aug 8, 2015 at 8:26 PM, John kerry wrote: > Hi, > > I have to keep 2 default settings for wireless, i means to say i have to > configure default settings for 2.4GHz and 5GHz. > > How i can configure wireless files. mainly i will add switch button in the > GUI to switch over 2.4GHz and 5GHz. > > How i can control this in backend, how i can add file which handle this > and configure 2 separate default settings for 2.4GHz and 5GHz. > > Thanks, > > On Fri, Aug 7, 2015 at 1:50 PM, David Lang wrote: > >> You cannot use both radios on the same channel, or even the same band. >> >> One radio will only work on channels 1-11 and the other will only work on >> channels 36+ >> >> pick which band you are going to use to connect to the remote AP and >> which you are going to use to have your clients connect to it. >> >> David Lang >> >> >> On Fri, 7 Aug 2015, John kerry wrote: >> >> Hi, >>> >>> >>> I have one and i configured as below: >>> >>> config wifi-device 'wifi0' >>>option type 'qcawifi' >>>option channel 'auto' >>>option macaddr '00:26:75:bd:37:24' >>>option hwmode '11ng' >>>option txpower '16' >>>option htmode 'HT20' >>> >>> config wifi-iface >>>option device 'wifi0' >>>option network 'lan' >>>option mode 'ap' >>>option ssid 'Test_Ap' >>>option encryption 'psk2' >>>option key 'Test_AP' >>> >>> >>> We can configure one radio only to work like that. >>> Something like below: >>> >>> config wifi-device 'radio0' >>> option type 'mac80211' > option channel '11' > option hwmode '11g' > option path 'platform/ar933x_wmac' > option htmode 'HT20' > option country 'US' > option txpower '20' > > config wifi-iface 'ap1' > option device 'radio0' > option mode 'ap' > option wds '1' > option ssid 'my AP' > option network 'lan' > > config wifi-iface 'mesh1' > option device 'radio0' > option mode 'mesh' > option mesh_id 'my mesh' > option network 'lan' > >>> >>> >>> On Fri, Aug 7, 2015 at 11:31 AM, Weedy wrote: >>> >>> On 6 Aug 2015 23:15, "John kerry" wrote: > > Hi, > > > Could anyone please help me on this to configure the wireless in such a > way that when we connect to wireless WAN the LAN SSID should not change. > > > Thanks, > You need 2 physical radios. >>> > ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH v3] lantiq: get more status information from xDSL
No, no need to change that, it was only question, for me it's ok, stats are working well on my ADSL line. W dniu 2015-08-06 o 21:40, Florian Eckert pisze: Am 06.08.2015 4:01 nachm. schrieb "Sylwek ScApi": > > I don't know that You done something wrong, You misunderstood me, as example We will use this part of patch: > : > @@ -226,16 +609,21 @@ line_state() { > fi > else > if [ "$ls" = "0x801" ]; then > - echo "Line State: UP [$ls: $s]" > + echo "Line State: UP [$ls: $s]" > else > - echo "Line State: DOWN [$ls: $s]" > + echo "Line State: DOWN [$ls: $s]" > fi > fi > } > > Why You replace tab separated "words" with space separated "words" ? I replaced this with space so i get a well formated output for "dsl_control status", If i use 3 tabs the out put will get too fare left on screen i think. I could change it If you want. > > Patch is send correctly but why replace "tabs" ? > > My thunderbird is white space broken so You need to look in Your source patch for reference. > > Best Regards > > 2015-08-06 11:52 GMT+02:00 Florian Eckert : >> >> Hello Petela >> >> sorry but i dont understand your question! >> >> I checked out openwrt with git and edited the file. After that i made >> "git format-patch -1" and then "git send-email --to >> openwrt-devel@lists.openwrt.org >> 0001-lantiq-get-more-status-information-from-xDSL.patch". I used the >> same whitespaces in this file as in the other functions of this file >> -> in this case it was an tab. What did i made wrong? >> >> Kind Regards Flo >> >> 2015-08-06 9:15 GMT+02:00 Sylwester Petela : >> > W dniu 2015-08-06 o 07:41, feckert pisze: >> > >> >> Signed-off-by: Florian Eckert >> >> Signed-off-by: Helge Mader >> >> Tested-by: Martin Blumenstingl >> >> Tested-by: Andre Heider >> >> --- >> >> >> >> v2 fix annex and line mode comma >> >> v2 fix latency to ms >> >> v3 fix latency syntax quotation error "x ms" >> >> v3 fix echo "" separation removed from status function >> >> >> >> .../lantiq/base-files/lib/functions/lantiq_dsl.sh | 412 >> >> +++- >> >> 1 file changed, 400 insertions(+), 12 deletions(-) >> >> mode change 100644 => 100755 >> >> target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh >> >> >> >> diff --git a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh >> >> b/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh >> >> old mode 100644 >> >> new mode 100755 >> >> index 56b8652..7809d01 >> >> --- a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh >> >> +++ b/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh >> >> @@ -19,6 +19,9 @@ dsl_cmd() { >> >> dsl_val() { >> >> echo $(expr "$1" : '.*'$2'=\([-\.[:alnum:]]*\).*') >> >> } >> >> +dsl_string() { >> >> + echo $(expr "$1" : '.*'$2'=(\([A-Z0-9,]*\))') >> >> +} >> >> # >> >> # Simple divide by 10 routine to cope with one decimal place >> >> @@ -49,6 +52,16 @@ scale() { >> >> fi >> >> } >> >> +scale_latency() { >> >> + local val=$1 >> >> + local a >> >> + local b >> >> + >> >> + a=$(expr $val / 100) >> >> + b=$(expr $val % 100) >> >> + printf "%d.%d ms" ${a} ${b} >> >> +} >> >> + >> >> # >> >> # Read the data rates for both directions >> >> # >> >> @@ -77,7 +90,7 @@ data_rates() { >> >> echo "dsl.data_rate_down_s=\"$sdrd\"" >> >> echo "dsl.data_rate_up_s=\"$sdru\"" >> >> else >> >> - echo "Data Rate: ${sdrd}/s / ${sdru}/s" >> >> +
Re: [OpenWrt-Devel] "3-address Wi-Fi bridging" (was: Multiple Wi-Fi client/AP interfaces on one radio)
Hi, I have to keep 2 default settings for wireless, i means to say i have to configure default settings for 2.4GHz and 5GHz. How i can configure wireless files. mainly i will add switch button in the GUI to switch over 2.4GHz and 5GHz. How i can control this in backend, how i can add file which handle this and configure 2 separate default settings for 2.4GHz and 5GHz. Thanks, On Fri, Aug 7, 2015 at 1:50 PM, David Lang wrote: > You cannot use both radios on the same channel, or even the same band. > > One radio will only work on channels 1-11 and the other will only work on > channels 36+ > > pick which band you are going to use to connect to the remote AP and which > you are going to use to have your clients connect to it. > > David Lang > > > On Fri, 7 Aug 2015, John kerry wrote: > > Hi, >> >> >> I have one and i configured as below: >> >> config wifi-device 'wifi0' >>option type 'qcawifi' >>option channel 'auto' >>option macaddr '00:26:75:bd:37:24' >>option hwmode '11ng' >>option txpower '16' >>option htmode 'HT20' >> >> config wifi-iface >>option device 'wifi0' >>option network 'lan' >>option mode 'ap' >>option ssid 'Test_Ap' >>option encryption 'psk2' >>option key 'Test_AP' >> >> >> We can configure one radio only to work like that. >> Something like below: >> >> config wifi-device 'radio0' >> >>> option type 'mac80211' option channel '11' option hwmode '11g' option path 'platform/ar933x_wmac' option htmode 'HT20' option country 'US' option txpower '20' config wifi-iface 'ap1' option device 'radio0' option mode 'ap' option wds '1' option ssid 'my AP' option network 'lan' config wifi-iface 'mesh1' option device 'radio0' option mode 'mesh' option mesh_id 'my mesh' option network 'lan' >>> >> >> >> On Fri, Aug 7, 2015 at 11:31 AM, Weedy wrote: >> >> On 6 Aug 2015 23:15, "John kerry" wrote: >>> Hi, Could anyone please help me on this to configure the wireless in such a >>> way that when we connect to wireless WAN the LAN SSID should not change. >>> Thanks, >>> >>> You need 2 physical radios. >>> >>> >> ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] iwinfo: report additional data for stations
Signed-off-by: Jernej Kos --- include/iwinfo.h | 11 +++ iwinfo_nl80211.c | 56 2 files changed, 67 insertions(+) diff --git a/include/iwinfo.h b/include/iwinfo.h index 57a88e2..1f58ef8 100644 --- a/include/iwinfo.h +++ b/include/iwinfo.h @@ -82,6 +82,17 @@ struct iwinfo_assoclist_entry { uint32_t tx_packets; struct iwinfo_rate_entry rx_rate; struct iwinfo_rate_entry tx_rate; + uint32_t rx_bytes; + uint32_t tx_bytes; + uint32_t tx_retries; + uint32_t tx_failed; + uint64_t t_offset; + uint8_t is_authorized:1; + uint8_t is_authenticated:1; + uint8_t is_preamble_short:1; + uint8_t is_wme:1; + uint8_t is_mfp:1; + uint8_t is_tdls:1; }; struct iwinfo_txpwrlist_entry { diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c index 2562492..99047b1 100644 --- a/iwinfo_nl80211.c +++ b/iwinfo_nl80211.c @@ -29,6 +29,8 @@ #define min(x, y) ((x) < (y)) ? (x) : (y) +#define BIT(x) (1ULL<<(x)) + static struct nl80211_state *nls = NULL; static void nl80211_close(void) @@ -1577,6 +1579,7 @@ static int nl80211_get_assoclist_cb(struct nl_msg *msg, void *arg) struct nlattr **attr = nl80211_parse(msg); struct nlattr *sinfo[NL80211_STA_INFO_MAX + 1]; struct nlattr *rinfo[NL80211_RATE_INFO_MAX + 1]; + struct nl80211_sta_flag_update *sta_flags; static struct nla_policy stats_policy[NL80211_STA_INFO_MAX + 1] = { [NL80211_STA_INFO_INACTIVE_TIME] = { .type = NLA_U32}, @@ -1585,6 +1588,13 @@ static int nl80211_get_assoclist_cb(struct nl_msg *msg, void *arg) [NL80211_STA_INFO_RX_BITRATE]= { .type = NLA_NESTED }, [NL80211_STA_INFO_TX_BITRATE]= { .type = NLA_NESTED }, [NL80211_STA_INFO_SIGNAL]= { .type = NLA_U8 }, + [NL80211_STA_INFO_RX_BYTES] = { .type = NLA_U32}, + [NL80211_STA_INFO_TX_BYTES] = { .type = NLA_U32}, + [NL80211_STA_INFO_TX_RETRIES]= { .type = NLA_U32}, + [NL80211_STA_INFO_TX_FAILED] = { .type = NLA_U32}, + [NL80211_STA_INFO_T_OFFSET] = { .type = NLA_U64}, + [NL80211_STA_INFO_STA_FLAGS] = + { .minlen = sizeof(struct nl80211_sta_flag_update) }, }; static struct nla_policy rate_policy[NL80211_RATE_INFO_MAX + 1] = { @@ -1652,6 +1662,52 @@ static int nl80211_get_assoclist_cb(struct nl_msg *msg, void *arg) if (rinfo[NL80211_RATE_INFO_SHORT_GI]) e->tx_rate.is_short_gi = 1; } + + if (sinfo[NL80211_STA_INFO_RX_BYTES]) + e->rx_bytes = nla_get_u32(sinfo[NL80211_STA_INFO_RX_BYTES]); + + if (sinfo[NL80211_STA_INFO_TX_BYTES]) + e->tx_bytes = nla_get_u32(sinfo[NL80211_STA_INFO_TX_BYTES]); + + if (sinfo[NL80211_STA_INFO_TX_RETRIES]) + e->tx_retries = nla_get_u32(sinfo[NL80211_STA_INFO_TX_RETRIES]); + + if (sinfo[NL80211_STA_INFO_TX_FAILED]) + e->tx_failed = nla_get_u32(sinfo[NL80211_STA_INFO_TX_FAILED]); + + if (sinfo[NL80211_STA_INFO_T_OFFSET]) + e->t_offset = nla_get_u64(sinfo[NL80211_STA_INFO_T_OFFSET]); + + /* Station flags */ + if (sinfo[NL80211_STA_INFO_STA_FLAGS]) + { + sta_flags = (struct nl80211_sta_flag_update *) + nla_data(sinfo[NL80211_STA_INFO_STA_FLAGS]); + + if (sta_flags->mask & BIT(NL80211_STA_FLAG_AUTHORIZED) && + sta_flags->set & BIT(NL80211_STA_FLAG_AUTHORIZED)) + e->is_authorized = 1; + + if (sta_flags->mask & BIT(NL80211_STA_FLAG_AUTHENTICATED) && + sta_flags->set & BIT(NL80211_STA_FLAG_AUTHENTICATED)) + e->is_authenticated = 1; + + if (sta_flags->mask & BIT(NL80211_STA_FLAG_SHORT_PREAMBLE) && + sta_flags->set & BIT(NL80211_STA_FLAG_SHORT_PREAMBLE)) + e->is_preamble_short = 1; + + if (sta_flags->mask & BIT(NL80211_STA_FLAG_WME) && + sta_flags->set & BIT(NL80211_STA_FLAG_WME)) + e->is_wme = 1; + + if (sta_flags->mask & BIT(NL80211_STA_FLAG_MFP) && + sta_flags->set & BIT(NL80211_STA_FLAG_MFP)) + e->is_mfp = 1; + + if (sta_flags->mask & BIT(NL80211_STA_FLAG_TDLS_PEER) && + sta_flags->set & BIT(NL80211_STA_FLAG_TDLS_PEER)) + e->is_tdls = 1; + }
Re: [OpenWrt-Devel] [PATCH 0/3] ipq806x: add NAND flash support
On Fri, 07 Aug 2015 20:09:14 +0200, Felix Fietkau wrote: On 2015-08-07 18:50, Mathieu Olivari wrote: Actually, I was asking myself the same questions yesterday. I was leaning towards dts for the reasons you mention below as well; the problem is on ref designs, there is no "standard" layout. The flash layout changes with time (an AP148 with an old boot binary blob will have a different layout than the same AP148 with a new boot image), sometimes with a certain application (some boots will have an SMEM with 2 kernels & 2 rootfs for dual partitioning). For this reason, and on ref designs, it'd be easier to have one dts and the kernel adapting at run-time, than multiplying the dts files and having to pick the right one based on your current SMEM content. Well, there's no reason to try to support old versions or nonstandard designs upstream. You just have to pick the one you consider upstream version. For what you are looking for, you might want to take a look at device tree overlays. I would agree that it's the exception though; on most retail routers, you would have one SMEM per SKU, i.e. one layout per dts. I'm thinking the most flexible way would probably to have the opportunity in dts to select between "dynamic" smem partitioning, or regular "fixed" partitioning. Not sure if something like this has ever been done in the past; but we could explore it. The bcm53xx target in OpenWrt works like that. The mtd driver specifies two partition parsers, first ofpart, then a custom one. If ofpart fails to find any partitions, the custom one gets to specify the layout. We could probably make use of something like that for ipq as well. Agreed, but I'm afraid 3rd party vendors will miss-use that as usual. Imre ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v2 2/2] uqmi: Add get-current-settings command-line switch
Adding --get-current-settings switch which can be used to query ip-settings among some other useful data obtained from remote end when connected. This is mainly useful with modems which do not provide a dhcp server for nameserver or ip-information (especially in ipv6 networks). Signed-off-by: Antti Seppälä Tested-by: Matti Laakso --- Notes: v2: Remove unintended whitespace formatting commands-wds.c | 123 + commands-wds.h | 4 +- 2 files changed, 126 insertions(+), 1 deletion(-) diff --git a/commands-wds.c b/commands-wds.c index fdf9003..fabb5f4 100644 --- a/commands-wds.c +++ b/commands-wds.c @@ -20,6 +20,7 @@ */ #include +#include #include "qmi-message.h" @@ -198,3 +199,125 @@ cmd_wds_set_ip_family_prepare(struct qmi_dev *qmi, struct qmi_request *req, stru uqmi_add_error("Invalid value (valid: ipv4, ipv6, unspecified)"); return QMI_CMD_EXIT; } + +static void wds_to_ipv4(const char *name, const uint32_t addr) +{ + struct in_addr ip_addr; + char buf[INET_ADDRSTRLEN]; + + ip_addr.s_addr = htonl(addr); + blobmsg_add_string(&status, name, inet_ntop(AF_INET, &ip_addr, buf, sizeof(buf))); +} + +static void wds_to_ipv6(const char *name, const uint16_t *addr) +{ + int i; + struct in6_addr ip_addr; + char buf[INET6_ADDRSTRLEN]; + + for (i = 0; i < ARRAY_SIZE(ip_addr.s6_addr16); i++) { + ip_addr.s6_addr16[i] = htons(addr[i]); + } + + blobmsg_add_string(&status, name, inet_ntop(AF_INET6, &ip_addr, buf, sizeof(buf))); +} + +static void +cmd_wds_get_current_settings_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg) +{ + void *v4, *v6, *d, *t; + struct qmi_wds_get_current_settings_response res; + const char *pdptypes[] = { + [QMI_WDS_PDP_TYPE_IPV4] = "ipv4", + [QMI_WDS_PDP_TYPE_PPP] = "ppp", + [QMI_WDS_PDP_TYPE_IPV6] = "ipv6", + [QMI_WDS_PDP_TYPE_IPV4_OR_IPV6] = "ipv4-or-ipv6", + }; + const struct ip_modes { + const char *name; + const QmiWdsIpFamily mode; + } modes[] = { + { "ipv4", QMI_WDS_IP_FAMILY_IPV4 }, + { "ipv6", QMI_WDS_IP_FAMILY_IPV6 }, + { "unspecified", QMI_WDS_IP_FAMILY_UNSPECIFIED }, + }; + int i; + + qmi_parse_wds_get_current_settings_response(msg, &res); + + t = blobmsg_open_table(&status, NULL); + + if (res.set.pdp_type && res.data.pdp_type < ARRAY_SIZE(pdptypes)) + blobmsg_add_string(&status, "pdp-type", pdptypes[res.data.pdp_type]); + + if (res.set.ip_family) { + for (i = 0; i < ARRAY_SIZE(modes); i++) { + if (modes[i].mode != res.data.ip_family) + continue; + blobmsg_add_string(&status, "ip-family", modes[i].name); + break; + } + } + + if (res.set.mtu) + blobmsg_add_u32(&status, "mtu", res.data.mtu); + + /* IPV4 */ + v4 = blobmsg_open_table(&status, "ipv4"); + + if (res.set.ipv4_address) + wds_to_ipv4("ip", res.data.ipv4_address); + if (res.set.primary_ipv4_dns_address) + wds_to_ipv4("dns1", res.data.primary_ipv4_dns_address); + if (res.set.secondary_ipv4_dns_address) + wds_to_ipv4("dns2", res.data.secondary_ipv4_dns_address); + if (res.set.ipv4_gateway_address) + wds_to_ipv4("gateway", res.data.ipv4_gateway_address); + if (res.set.ipv4_gateway_subnet_mask) + wds_to_ipv4("subnet", res.data.ipv4_gateway_subnet_mask); + blobmsg_close_table(&status, v4); + + /* IPV6 */ + v6 = blobmsg_open_table(&status, "ipv6"); + + if (res.set.ipv6_address) { + wds_to_ipv6("ip", res.data.ipv6_address.address); + blobmsg_add_u32(&status, "ip-prefix-length", res.data.ipv6_address.prefix_length); + } + if (res.set.ipv6_gateway_address) { + wds_to_ipv6("gateway", res.data.ipv6_gateway_address.address); + blobmsg_add_u32(&status, "gw-prefix-length", res.data.ipv6_gateway_address.prefix_length); + } + if (res.set.ipv6_primary_dns_address) + wds_to_ipv6("dns1", res.data.ipv6_primary_dns_address); + if (res.set.ipv6_secondary_dns_address) + wds_to_ipv6("dns2", res.data.ipv6_secondary_dns_address); + + blobmsg_close_table(&status, v6); + + d = blobmsg_open_table(&status, "domain-names"); + for (i = 0; i < res.data.domain_name_list_n; i++) { + blobmsg_add_string(&status, NULL, res.data.domain_name_list[i]); + } + blobmsg_close_table(&status, d); + + blobmsg_close_table(&status, t); +} + +static enum qmi_cmd_result +cmd_wds_get_current_settings_prepare(struct qmi_dev *qmi, struct
[OpenWrt-Devel] [PATCH v2 1/2] uqmi: Add IP family selection command-line switch
This patch adds support for (optionally) specifying ip family via a command- line switch. The switch sends respective "Set IP Family" WDS message to qmi-device before actually connecting. Using this switch allows connecting to ipv6 enabled networks or networks with dual-stack support with the appropriate hardware (dongle and FW with ipv6 support) and configuration (AT+CGDCONT reporting ipv6 or ipv4v6 capability). Help text: --ip-family :Set ip-family for the connection (ipv4, ipv6, unspecified) Usage example for ipv6: uqmi -d /dev/cdc-wdm0 --set-client-id wds, --start-network --ip-family ipv6 Dual-stack usage example: uqmi -d /dev/cdc-wdm0 --get-client-id wds uqmi -d /dev/cdc-wdm0 --set-client-id wds, --start-network --ip-family ipv4 uqmi -d /dev/cdc-wdm0 --get-client-id wds uqmi -d /dev/cdc-wdm0 --set-client-id wds, --start-network --ip-family ipv6 Signed-off-by: Antti Seppälä Tested-by: Matti Laakso --- Notes: v2: No changes commands-wds.c | 28 commands-wds.h | 2 ++ 2 files changed, 30 insertions(+) diff --git a/commands-wds.c b/commands-wds.c index aa57d03..fdf9003 100644 --- a/commands-wds.c +++ b/commands-wds.c @@ -170,3 +170,31 @@ cmd_wds_reset_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_m qmi_set_wds_reset_request(msg); return QMI_CMD_REQUEST; } + +#define cmd_wds_set_ip_family_cb no_cb +static enum qmi_cmd_result +cmd_wds_set_ip_family_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg) +{ + struct qmi_wds_set_ip_family_request ipf_req; + const struct ip_modes { + const char *name; + const QmiWdsIpFamily mode; + } modes[] = { + { "ipv4", QMI_WDS_IP_FAMILY_IPV4 }, + { "ipv6", QMI_WDS_IP_FAMILY_IPV6 }, + { "unspecified", QMI_WDS_IP_FAMILY_UNSPECIFIED }, + }; + int i; + + for (i = 0; i < ARRAY_SIZE(modes); i++) { + if (strcasecmp(modes[i].name, arg) != 0) + continue; + + qmi_set(&ipf_req, preference, modes[i].mode); + qmi_set_wds_set_ip_family_request(msg, &ipf_req); + return QMI_CMD_REQUEST; + } + + uqmi_add_error("Invalid value (valid: ipv4, ipv6, unspecified)"); + return QMI_CMD_EXIT; +} diff --git a/commands-wds.h b/commands-wds.h index 19e6406..8ddfb1e 100644 --- a/commands-wds.h +++ b/commands-wds.h @@ -24,6 +24,7 @@ __uqmi_command(wds_set_auth, auth-type, required, CMD_TYPE_OPTION), \ __uqmi_command(wds_set_username, username, required, CMD_TYPE_OPTION), \ __uqmi_command(wds_set_password, password, required, CMD_TYPE_OPTION), \ + __uqmi_command(wds_set_ip_family, ip-family, required, CMD_TYPE_OPTION), \ __uqmi_command(wds_set_autoconnect, autoconnect, no, CMD_TYPE_OPTION), \ __uqmi_command(wds_stop_network, stop-network, required, QMI_SERVICE_WDS), \ __uqmi_command(wds_get_packet_service_status, get-data-status, no, QMI_SERVICE_WDS), \ @@ -36,6 +37,7 @@ "--auth-type pap|chap|both|none: Use network authentication type\n" \ "--username : Use network username\n" \ "--password : Use network password\n" \ + "--ip-family : Use ip-family for the connection (ipv4, ipv6, unspecified)\n" \ "--autoconnect: Enable automatic connect/reconnect\n" \ " --stop-network : Stop network connection (use with option below)\n" \ "--autoconnect: Disable automatic connect/reconnect\n" \ -- 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 v2 0/2] uqmi: Improve ipv6 connectivity
v2: Resending the series because of a small mistake in whitespace handling in the second patch. Here is a set of two patches which improve uqmi when connecting to ipv6 enabled networks. The first patch adds the capability to select the ip-family that is used when connecting (ipv4 or ipv6). The second patch can be used to output the obtained ip information from connected networks. With proper configuration these patches can be utilized to establish a working dual-stack connection with a qmi device and then configure system ip-information accordingly. Antti Seppälä (2): uqmi: Add IP family selection command-line switch uqmi: Add get-current-settings command-line switch commands-wds.c | 151 + commands-wds.h | 6 ++- 2 files changed, 156 insertions(+), 1 deletion(-) -- 2.1.4 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel