OpenWrt Forum Archive

Topic: Netgear R8000 support?

The content of this topic has been archived between 23 Mar 2018 and 5 May 2018. Unfortunately there are posts – most likely complete pages – missing.

Your wireless interface is disabled, that's why.

arokh wrote:

Your wireless interface is disabled, that's why.

What do you mean? I don't recall i disable the interface and it's just newly flashed and booted. Then I delete the /etc/config/wireless to run wifi detect.

I'll double check. I know my first device is disabled since it's just flashed and with factory settings.

However, the problem is that this router should have 3 interfaces which I only have one with trunk build but shows 3 devices in CC build.

It's not about the first device, it works fine.

I had to move a lot of posts to arokh's thread again.

If you flash arokh's firmware and experience some problem, report it in arokh's thread. Do not report it here.

arokh's builds are experimental, they use kernel 4.4 that is still broken & untested on bcm53xx devices.

Actually, they use 4.1 kernel. The 4.4 build was a one off and has been removed as it was not bootable. My only mod to current trunk is setting the country code to US as has been recommended in this thread, so the radio issue should be relevant.

visata wrote:

The latest code from trunk also bricked my router, here is the log:

There isn't any special error visible in your log. OpenWrt booted fine. What's the issue?

LogicoZone wrote:

It seems the 1 radio issue should be fixed in 47467 but I'm still having same issue to see only 1 radio.

The problem fixed in r47467 was brcmfmac treating all three BCM43602 devices as 2.4 GHz ones.

LogicoZone wrote:

However, the problem is that this router should have 3 interfaces which I only have one with trunk build but shows 3 devices in CC build.

This is correct. It seems updating Broadcom's iproc driver in trunk broke detecting all PCIe devices on R8000.

arokh wrote:

Actually, they use 4.1 kernel. The 4.4 build was a one off and has been removed as it was not bootable. My only mod to current trunk is setting the country code to US as has been recommended in this thread, so the radio issue should be relevant.

Good to know, thanks for info!

So we have 2 important issues with R8000:

1) Netgear R8000 - cannot open "ubi0:rootfs", error -19
https://dev.openwrt.org/ticket/20731
Exists in both: CC and trunk. Affects selected units only.

2) Regression: pcie_iproc_bcma detects only 1 device on Netgear R8000
https://dev.openwrt.org/ticket/21393
Exists in trunk only. Affects all units.

I double checked the logs and it appears it booted indeed. Most likely I couldn't access the router because I did a few pings and assumed it was bricked.

Zajec, let me know when you have something to test.

visata wrote:

I double checked the logs and it appears it booted indeed. Most likely I couldn't access the router because I did a few pings and assumed it was bricked.

Zajec, let me know when you have something to test.

I'm wondering if this can be related to the r47692. Please provide output of:

cat /etc/config/network
swconfig dev switch0 show | grep port
nvram show | grep ports

Should I flash with CC or trunk?

visata wrote:

Should I flash with CC or trunk?

The one that has broken network support according to you. Maybe you should verify if network really isn't working? I'm not convinced if you really see some problem.

I will flash with trunk later tonight and post the output. I don't have a permanent access to a serial connection. If it bricks it, I will have to tear apart the router again.

LogicoZone reported that trunk works, so it might be that I didn't test enough and everything is fine with a trunk build. I usually disable/enable my Ethernet card on a PC when I try any new build but I didn't do that then because I assumed that trunk is also with 4.4 kernel...

I've just flashed with trunk R8000 and network is working fine. I tried installing luci but couldn't:

root@OpenWrt:~# opkg update
Downloading http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/package                                            s/base/Packages.gz.
wget: bad address 'downloads.openwrt.org'
Downloading http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/package                                            s/base/Packages.sig.
wget: bad address 'downloads.openwrt.org'
Signature check failed.
Remove wrong Signature file.
Downloading http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/package                                            s/luci/Packages.gz.
wget: bad address 'downloads.openwrt.org'
Downloading http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/package                                            s/luci/Packages.sig.
wget: bad address 'downloads.openwrt.org'
Signature check failed.
Remove wrong Signature file.
Downloading http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/package                                            s/management/Packages.gz.
wget: bad address 'downloads.openwrt.org'
Downloading http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/package                                            s/management/Packages.sig.
wget: bad address 'downloads.openwrt.org'
Signature check failed.
Remove wrong Signature file.
Downloading http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/package                                            s/packages/Packages.gz.
wget: bad address 'downloads.openwrt.org'
Downloading http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/package                                            s/packages/Packages.sig.
wget: bad address 'downloads.openwrt.org'
Signature check failed.
Remove wrong Signature file.
Downloading http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/package                                            s/routing/Packages.gz.
wget: bad address 'downloads.openwrt.org'
Downloading http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/package                                            s/routing/Packages.sig.
wget: bad address 'downloads.openwrt.org'
Signature check failed.
Remove wrong Signature file.
Downloading http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/package                                            s/telephony/Packages.gz.
wget: bad address 'downloads.openwrt.org'
Downloading http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/package                                            s/telephony/Packages.sig.
wget: bad address 'downloads.openwrt.org'
Signature check failed.
Remove wrong Signature file.
Collected errors:
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trun                                            k/bcm53xx/generic/packages/base/Packages.gz, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trun                                            k/bcm53xx/generic/packages/base/Packages.sig, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trun                                            k/bcm53xx/generic/packages/luci/Packages.gz, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trun                                            k/bcm53xx/generic/packages/luci/Packages.sig, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trun                                            k/bcm53xx/generic/packages/management/Packages.gz, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trun                                            k/bcm53xx/generic/packages/management/Packages.sig, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trun                                            k/bcm53xx/generic/packages/packages/Packages.gz, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trun                                            k/bcm53xx/generic/packages/packages/Packages.sig, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trun                                            k/bcm53xx/generic/packages/routing/Packages.gz, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trun                                            k/bcm53xx/generic/packages/routing/Packages.sig, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trun                                            k/bcm53xx/generic/packages/telephony/Packages.gz, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trun                                            k/bcm53xx/generic/packages/telephony/Packages.sig, wget returned 1.
root@OpenWrt:~# opkg install luci
Unknown package 'luci'.
Collected errors:
 * opkg_install_cmd: Cannot install package luci.
root@OpenWrt:~# opkg update
Downloading http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/package                                            s/base/Packages.gz.
wget: bad address 'downloads.openwrt.org'
Downloading http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/package                                            s/base/Packages.sig.
wget: bad address 'downloads.openwrt.org'
Signature check failed.
Remove wrong Signature file.
Downloading http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/package                                            s/luci/Packages.gz.
wget: bad address 'downloads.openwrt.org'
Downloading http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/package                                            s/luci/Packages.sig.
wget: bad address 'downloads.openwrt.org'
Signature check failed.
Remove wrong Signature file.
Downloading http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/package                                            s/management/Packages.gz.
wget: bad address 'downloads.openwrt.org'
Downloading http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/package                                            s/management/Packages.sig.
wget: bad address 'downloads.openwrt.org'
Signature check failed.
Remove wrong Signature file.
Downloading http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/package                                            s/packages/Packages.gz.
wget: bad address 'downloads.openwrt.org'
Downloading http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/package                                            s/packages/Packages.sig.
wget: bad address 'downloads.openwrt.org'
Signature check failed.
Remove wrong Signature file.
Downloading http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/package                                            s/routing/Packages.gz.
wget: bad address 'downloads.openwrt.org'
Downloading http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/package                                            s/routing/Packages.sig.
wget: bad address 'downloads.openwrt.org'
Signature check failed.
Remove wrong Signature file.
Downloading http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/package                                            s/telephony/Packages.gz.
wget: bad address 'downloads.openwrt.org'
Downloading http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/package                                            s/telephony/Packages.sig.
wget: bad address 'downloads.openwrt.org'
Signature check failed.
Remove wrong Signature file.
Collected errors:
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trun                                            k/bcm53xx/generic/packages/base/Packages.gz, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trun                                            k/bcm53xx/generic/packages/base/Packages.sig, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trun                                            k/bcm53xx/generic/packages/luci/Packages.gz, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trun                                            k/bcm53xx/generic/packages/luci/Packages.sig, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trun                                            k/bcm53xx/generic/packages/management/Packages.gz, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trun                                            k/bcm53xx/generic/packages/management/Packages.sig, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trun                                            k/bcm53xx/generic/packages/packages/Packages.gz, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trun                                            k/bcm53xx/generic/packages/packages/Packages.sig, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trun                                            k/bcm53xx/generic/packages/routing/Packages.gz, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trun                                            k/bcm53xx/generic/packages/routing/Packages.sig, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trun                                            k/bcm53xx/generic/packages/telephony/Packages.gz, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trun                                            k/bcm53xx/generic/packages/telephony/Packages.sig, wget returned 1.

Still only 1 radio detected.

Not sure whether you still need the output you requested, but I'm posting anyway:

root@OpenWrt:~# cat /etc/config/network

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fda0:0454:5e1b::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0.1'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config interface 'wan'
        option ifname 'eth0.2'
        option proto 'dhcp'

config interface 'wan6'
        option ifname 'eth0.2'
        option proto 'dhcpv6'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '0 1 2 3 5t'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '4 5t'

root@OpenWrt:~# cat /etc/config/wireless
config wifi-device  radio0
        option type     mac80211
        option channel  36
        option hwmode   11a
        option path     'platform/18000000.axi/bcma0:7/pci0000:00/0000:00:00.0/0000:01:00.0'
        option htmode   VHT80
        # REMOVE THIS LINE TO ENABLE WIFI:
        option disabled 1

config wifi-iface
        option device   radio0
        option network  lan
        option mode     ap
        option ssid     OpenWrt
        option encryption none

root@OpenWrt:~# swconfig dev switch0 show | grep port
        ports: 0x01bf
        link: port:0 link:up speed:1000baseT full-duplex auto
        link: port:1 link:up speed:1000baseT full-duplex auto
        link: port:2 link:down
        link: port:3 link:down
        link: port:4 link:down
        link: port:5 link:up speed:1000baseT full-duplex
        ports: 0 1 2 3 5t
        ports: 4 5t
root@OpenWrt:~# nvram show | grep ports
vlan2ports=4 8u
vlan1ports=0 1 2 3 5 7 8*
vlan_ports=0x3FF

Let me know if you need any other debug info.

meuleman wrote:

Spent some time today on this issue and there is indeed a problem with brcmfmac/firmware running on OpenWrt when it comes to setting country codes. Unfortunately there is no easy workaround. Some details first: The country code being set by userspace needs a translation to a country which can be used by the firmware. This should have been done by the driver, but it isn't. The biggest problem for us (driver developers) is that the translation is board/platform specific. So the R8000 needs its own mapping which we can not determine runtime.

The only workaround for the moment is selecting the country US, but that should not be done when being in an other country.

There is also another "quick" workaround, but that will need a patch on brcmfmac and hence a new build. The country code configured by Netgear user interface gets set in NVRAM. This country code is "correct" and should not be overwritten by the driver. So by commenting out the code which which actually programs the "country" in the driver would work around the problem, but wont allow you to select a different country/region from the user interface, but once configured correctly through the netgear firmware this should not be necessary unless you physically move the AP to a different country/region.

Can you help me understanding some details of this problem?

1. Country code translation
I understand Broadcom's firmware uses different codes than Linux (at least some of them). But why do you think code translation is board/platform specific? Linux uses a set of defined codes, see:
http://git.kernel.org/cgit/linux/kernel … ree/db.txt
So it seems to me that:
a) Some codes can be used difectly, e.g. "US", "DE", "PL":

# iw reg set US
[13191.210728] brcmfmac: brcmf_cfg80211_reg_notifier: enter: initiator=1, alpha=US
[13191.230701] brcmfmac: brcmf_cfg80211_reg_notifier: enter: initiator=1, alpha=US
[13191.244864] cfg80211: Regulatory domain changed to country: US
[13191.250672] cfg80211:  DFS Master region: FCC
[13191.254858] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[13191.264558] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 3000 mBm), (N/A)
[13191.272539] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2300 mBm), (N/A)
[13191.281987] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2300 mBm), (0 s)
[13191.291428] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2300 mBm), (0 s)
[13191.299489] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 3000 mBm), (N/A)
[13191.307464] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)

b) Some codes need to be translated ,e.g. "00"

root@OpenWrt:/# iw reg set 00
[13227.053992] cfg80211: Invalid regulatory domain detected:
[13227.059429] cfg80211: Regulatory domain: 00
[13227.063590] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[13227.073138] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[13227.081117] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[13227.089089] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
[13227.097067] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
[13227.106509] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
[13227.115952] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[13227.124003] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[13227.131979] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
[13227.140125] brcmfmac: brcmf_cfg80211_reg_notifier: enter: initiator=0, alpha=00
[13227.147597] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code
[13227.154245] brcmfmac: brcmf_cfg80211_reg_notifier: enter: initiator=0, alpha=00
[13227.161780] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code
[13227.168439] cfg80211: World regulatory domain updated:
[13227.173795] cfg80211:  DFS Master region: unset
[13227.178224] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[13227.187932] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[13227.195908] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[13227.203872] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
[13227.211848] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
[13227.221300] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
[13227.230743] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[13227.238812] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[13227.246787] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)

2. "US" workaround
Why selecting "US" is the only workaround? What's the problem in the first place? Why I can't simply use e.g. "PL" if living in Poland?

3. Quick workaround (hacking brcmf_cfg80211_reg_notifier?)
First of all, are you use firmware gets country code set in NVRAM? Take a look at this:

root@OpenWrt:/# nvram show | grep country_code
wl1_country_code=US
wl0_country_code=US
wl_country_code=US
root@OpenWrt:/# nvram show | grep devid
0:devid=0x43BB
1:devid=0x43BC

As my SR400ac doesn't have "0:country_code" or "1:country_code" entries, I'm afraid we never pass any country_code to the firmware.

Second question: why hacking "brcmf_cfg80211_reg_notifier" should result in any better result that simply setting a proper country in OpenWrt? Why I can't simply do:
iw reg set PL

Zajec wrote:
Booting problem (UBI/rootfs)

It's reported with a nice log in ticket #20731. For some reason UBI partition isn't available or recognized and OpenWrt can't boot userspace. Looks like a valid report and serious problem. I'll try to track/debug/fix this problem in the mentioned ticket.

Fixed now in both: trunk & chaos_calmer.

Zajec wrote:

Can you help me understanding some details of this problem?

Yes, I'll try. I'm currently working on getting it all in place. The exact reason for some of the choices made within firmware I don't know, but there are some obvious reasons to think about.

Zajec wrote:

1. Country code translation
I understand Broadcom's firmware uses different codes than Linux (at least some of them). But why do you think code translation is board/platform specific?

The board/platform specific translation is due to the firmware/hardware of the board. When it comes to country codes then there are a couple of factors which determine which country code / regrev are supported by the FW API. 1) The firmware has impact. It is compiled for a certain product and with that supports certain country codes /regrev. 2) The OTP. Some boards (actually most of them) get their board specific data from OTP. This is being programmed during production. 3) NVRAM. This file is specific to a board (not a device, you cannot and never should use a nvram used on a certain board on another board even though it is the same chipset). Now, why? Well there is at least one reason and that is power constraints, however power constraints are not only determined by FCC (or whatever organisation) but also by board characteristics. Each board is different and as such needs to be calibrated. With that I mean that 43602 on a R8000 is behaving completely different from the 43602 used in for example Apple mac book. Probably the mac book version doesn't have an external PA, and this component has a huge impact on the power to be used to work efficiently. Many people think that it is good thing to higher the output power to get more range, and that power is only limited by bodies like FCC. This is not true, and in fact higher powers will often result in lower throughput as the signal gets distorted, but not only that, it will also have more impact on neighboring channels where it would be out of specification.

So that is why it is board specific. Every board is different. However there is more. Some products get sold worldwide, some of them only in limited countries. And some vendors want to simplify the user interface. So each product can be different from that point of view. For example: A product which is to be used in US only will most of the time be only configurable for US or World. And world is not what you want as it is minimal set which makes it allowed to work in any country. Very often these products will not be sold to other countries (not allowed by the stores) and often will not work (at least not optimal) in other countries either. The reason that a vendor is doing this is simple: It costs money (quite a bit) to get certified, and the more countries it desires to support the higher the costs. There are also vendors (like netgear) which try to simplify the user interface and have country codes grouped by region. So in case of netgear there are something like 10 regions: US, EU, CN, etc.. In this case US does not mean USA like it does in ISO3166 (alpha2) but it means quite a few more countries. And it uses the combined set of limitations of these countries to configure the device. This is in general almost the same as US but not 100%.

Now for the final reason, which I started by explaining that US in netgear means something else as US in Macbook (and US in linux db); To support US for both devices with the same firmware the API of the firmware uses a country code and a regrev code. The country code is not an ISO3166 version first of all, but often is (but not always). Like EU is not used by linux, though it is an (exceptional) ISO3166 country code. The regrev is used to support both US as a country and US as region, and for every product we (broadcom) create new regrevs.

So this is why we need a translation of ISO3166 (alpha2) country code to a broadcom API (country code with regrev) and that translation will be different per board.

Zajec wrote:

2. "US" workaround
Why selecting "US" is the only workaround? What's the problem in the first place? Why I can't simply use e.g. "PL" if living in Poland?

Well simply because Poland it not even a possible/valid country code within this combination of device/firmware/nvram. You would have to use EU. However even that would not work optimal. We (driver team) thought we could use a country code and regrev -1. This turned out not to be true. For some country codes it will work, but for some it wont. In case of the R8000 the US/-1 will work and that is why when used with OpenWrt on R8000 this is the best country code to use.

Zajec wrote:

3. Quick workaround (hacking brcmf_cfg80211_reg_notifier?)
First of all, are you use firmware gets country code set in NVRAM? Take a look at this:

root@OpenWrt:/# nvram show | grep country_code
wl1_country_code=US
wl0_country_code=US
wl_country_code=US
root@OpenWrt:/# nvram show | grep devid
0:devid=0x43BB
1:devid=0x43BC

As my SR400ac doesn't have "0:country_code" or "1:country_code" entries, I'm afraid we never pass any country_code to the firmware.

It could very well be that the SR400AC is programmed with a correct country code. Either through OTP or through other settings in NVRAM. In that case you really wouldnt want to override it with anything. If not then you would have to figure out which codes are supported by the device and create a translation table.

Zajec wrote:

Second question: why hacking "brcmf_cfg80211_reg_notifier" should result in any better result that simply setting a proper country in OpenWrt? Why I can't simply do:
iw reg set PL

Good to know: most products when sold, either have a correct country code in OTP or in NVRAM matching the country in which the product is sold. In case of R8000 I don't know if it defaults to the correct country/region, but I believe so. In case of R8000 this setting is stored in NVRAM. When the firmware boots it will initial use this country code or if nothing is programmed, fall back to world code.
What we will do in the driver is that we will translate the used country codes to country code/regrev, if a translation table is available. When there is no translation table available nothing will be programmed. First problem is that cfg80211 only specifies ISO3166 (alpha2), but doesnt tell if it for example allows EU. In fact I think that is up to userspace, but not 100% sure here, though it doesn't really matter, as the API of the FW will require a translation table anyway.
https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
So what I intend to do (work in progress) is offer the option to specify a translation table through platform data, which will be device (device id/revision) specific. If this table is available then it will be used to try to translate the used code. If the table is not available or if the translation is not successful then no country code will be programmed. The first patch is on the way and it will basically look if there is a table and if not it wont program any country code. The result is basically the same as my suggestion to hack the reg_notifier and not program any country code. Simply because the country code of the device is most likely already correct.

Thanks Hante. So far I was thinking all board specific data is in NVRAM. I saw these magic entries like aa5g, maxp5ga0, mcsbw205ghpo, pa5ga0, etc. and I was assuming it's all that firmware needs for a proper setup.

I wasn't aware there are more data compiled into firmware that firmware choses depending on the regrev.

Do I get it correctly that calling
iw reg set US
(that results in passing rev -1 to the firmware) may cause firmware use incorrect calibration data? AFAIU you were assuming rev -1 tells firmware to change *only* country (without changing rev) but it's not the case?

Has anyone done a few power cycles on their R8000 and noticed it failing to boot? I have two units both with the same behavior. Flash to Openwrt, boots fine all is well. Reboot, things are fine. Power down, leave it for a day or two, power back on and blamo:
Checking crc...Boot program checksum is invalid

And yet the previous day it was working fine. I also had this happen randomly after something like 5 or 6 reboots. Only solution is to then reflash the Openwrt image. I will do some more testing today to see if I can determine how frequently/often this comes up to try and make it reproduceable.

I got few bugs to report. Would provide the logs if needed.

1. Slow Wifi TX Speed as per Mac.
I tried the latest CC build, and weirdly it keeps me at around 200Mbps / 170Mbps only on Wifi AC.
Tried restarting the Router and changing any options either leads to No Wifi, or Same Slow Speed.

2. Luci does not show Wifi Signal db's keeps it at 0db.

3. Changing country to many options lead to wifi being disabled.

4. OpenWrt shows that it has only 38MB available, but isn't the Flash size 128MB ?

5. Trunk is still showing only 1 Wireless Device is available. I know its a known bug, and the cause is also found, but whats the plan forward ? Should we build it locally only ?

(Last edited by adityaxavier on 17 Jan 2016, 17:11)

adityaxavier wrote:

2. Luci does not show Wifi Signal db's keeps it at 0db.

This may be fixed by https://dev.openwrt.org/changeset/48166/

adityaxavier wrote:

4. OpenWrt shows that it has only 38MB available, but isn't the Flash size 128MB ?

It's because of ugly partitioning used by Broadcom. They use separated "roofs" and "bcrmnand" partitions. Currently there is no way to extend basic partition/volume using another one.

adityaxavier wrote:

5. Trunk is still showing only 1 Wireless Device is available. I know its a known bug, and the cause is also found, but whats the plan forward ? Should we build it locally only ?

No plan right now. I don't have any device with 3 bands so I cannont reproduce & work on this issue.

Wow what an omnious post No.

Anyway, regarding issue 2 :
Isn't that patch already put in in the latest CC release ?

Regarding 4:
I understand, do let me know if i can be of any help testing.

Regarding 5:
Please do let me know if you need any help testing the same. Promise i'll be quick smile
Or better yet, you can ssh into my router and try whatever you need to wink

Regarding 1:
Would you be able to help me out on this ? Let me know if you need any logs.

Regarding 3:
I believe it has to do with the same Issue of Country Code issue.

Another Issue :
LED's don't work as they are supposed. Do let me know if i can help !

(Last edited by adityaxavier on 17 Jan 2016, 20:04)

Zajec wrote:
adityaxavier wrote:

2. Luci does not show Wifi Signal db's keeps it at 0db.

This may be fixed by https://dev.openwrt.org/changeset/48166/

adityaxavier wrote:

4. OpenWrt shows that it has only 38MB available, but isn't the Flash size 128MB ?

It's because of ugly partitioning used by Broadcom. They use separated "roofs" and "bcrmnand" partitions. Currently there is no way to extend basic partition/volume using another one.

adityaxavier wrote:

5. Trunk is still showing only 1 Wireless Device is available. I know its a known bug, and the cause is also found, but whats the plan forward ? Should we build it locally only ?

No plan right now. I don't have any device with 3 bands so I cannont reproduce & work on this issue.

Hi,

I believe currently, the major Issues are :-

1. Slow WiFi Speeds ( around 170 - 200 Mbps on AC )
2. Only Single Wifi is detected in Trunk.
    ( Can you please verify, i find that few patches are missing in patches-4.4 folder, but present in 4.1 folder)
3. GPIO LEDS not working.
    ( Would http://svn.dd-wrt.com/browser/src/route … ?rev=28812 be of any help ?)
    Am planning on spending more time on it this weekend.
4. Regarding cannot open "ubi0:rootfs", error -19, as per the ticket and your previous Message it exists in both trunk and CC, but i find this happening only using Trunk.
5. Regarding the size available for Openwrt, i also own a Asus AC56U which has BCM4708A0 which i thought was pretty similar to BCM4709A0 except few differences regarding speed and pcie support. And Asus AC56U is giving me complete 128MB size available. I might be completely wrong about them being similar though smile

Sorry for pushing you smile

Thanks,
Aditya Xavier.

(Last edited by adityaxavier on 18 Jan 2016, 13:41)

adityaxavier wrote:

1. Slow WiFi Speeds ( around 170 - 200 Mbps on AC )

Can you provide some details on what you're testing here? Which OpenWrt image are you using (trunk or CC)? Which band? 2.4 or 5G? Which country code have you configured? What client device are you using? Which channel? Are you using device 1, 2 or three of the router to connect to? What is distance from client card to router? Which tool do you use for measurement (iperf or something else)? Do you test against remote on WAN or LAN? Do you have interference from other APs? Are you testing UDP or TCP, Tx or Rx? And then I'll probably have a few questions more, but need some answers first on the given questions here.

When I try locally on 5G any channel, using a good AC client card (three antennas) and on short distance I reach easily 600Mbps TCP on either Rx or Tx. This is not the max of this router, but still very decent. So in the correct circumstances you should be able to get a whole lot more then 200Mbps.

Thanks for the reply !

1. Am using OpenWrt CC build :- r46450
2. Am using 5G (radio0) - AC Band for testing.
3. Distance between Client and Router is around 8ft apart ( Clear view of sight )
4. Client is MacBook Pro 2015
5. Am testing using the drop down details of Wifi attaching images for reference.
6. I can't test using iPerf cause somehow it keeps hanging at 13 bits ( possibly OSX Issue )
7. Same router, at same distance using same client, using stock Firmware am getting between 1053-1300Mbps (UI)
8. Am only testing LAN Speeds.

Stock Firmware :- http://picpaste.com/Screen_Shot_2016-01 … ajTNia.png
OpenWrt :- http://picpaste.com/Screen_Shot_2016-01 … s1lasR.png

OpenWrt Config :-

config wifi-device 'radio0'
    option type 'mac80211'
    option hwmode '11a'
    option path '18000000.axi/bcma0:7/pci0000:00/0000:00:00.0/0000:01:00.0'
    option htmode 'VHT80'
    option channel '40'
    option txpower '20'
    option country '00'

config wifi-iface
    option device 'radio0'
    option network 'lan'
    option mode 'ap'
    option ssid 'AdityaXavier5G1'
    option encryption 'psk2'

I think i have found another issue.. Something which doesn't make much sense.

You can see in the configuration i have set it to be at Channel 40. But i see that the signal is at Channel 48 !

dmesg :- http://pastebin.com/rxvmgctK
nvram :- http://pastebin.com/bcchQLd9

Apart from this please do let me know if you need anymore data.

(Last edited by adityaxavier on 18 Jan 2016, 18:57)