Bug 193121 - brcmfmac working extremely poorly on MacBookPro13,*
Summary: brcmfmac working extremely poorly on MacBookPro13,*
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: network-wireless (show other bugs)
Hardware: x86-64 Linux
: P1 normal
Assignee: drivers_network-wireless@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-22 10:19 UTC by Ronald
Modified: 2018-11-17 14:58 UTC (History)
54 users (show)

See Also:
Kernel Version: 4.8.0, 4.9.4, 4.9.5
Tree: Mainline
Regression: No


Attachments
Output of 'lspci -vvnn' (3.61 KB, application/octet-stream)
2017-01-22 10:19 UTC, Ronald
Details
Output from 'iw list' (2.82 KB, text/plain)
2017-01-22 10:20 UTC, Ronald
Details
Output from 'modinfo brcmfmac' (4.02 KB, text/plain)
2017-01-22 10:21 UTC, Ronald
Details
Output from dmesg after building brcmfmac with CONFIG_BRCMDBG=y and setting debug to 0x7fffffff (17.47 KB, application/gzip)
2017-01-22 10:24 UTC, Ronald
Details
dmesg output of "insmod brcmfmac debug=0xd416" with Linux 4.13-rc1 (22.22 KB, application/gzip)
2017-07-26 13:26 UTC, Daniel Roschka
Details
attachment-17819-0.html (4.03 KB, text/html)
2018-05-25 08:25 UTC, Satya Arjunan
Details

Description Ronald 2017-01-22 10:19:17 UTC
Created attachment 252761 [details]
Output of 'lspci -vvnn'

The late 2016 MBP has a Broadcom 43602 rev2 wireless controller. The brcmfmac module is loaded correctly, but the resulting wifi has several issues:

* Extremely poor reception
  ------------------------

  Have to be within about 10 feet of the AP to get any signal; at 5 feet distance iwconfig shows

  wlp3s0    IEEE 802.11  ESSID:"..."
            Mode:Managed  Frequency:2.437 GHz  Access Point: ...
            Bit Rate=24 Mb/s   Tx-Power=31 dBm
            Retry short limit:7   RTS thr:off   Fragment thr:off
            Power Management:on
            Link Quality=37/70  Signal level=-73 dBm
            Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
            Tx excessive retries:16  Invalid misc:0   Missed beacon:0

* No 5GHz Band
  ------------

  Only 2.4GHz is present - see attached 'iw list' output.

* Wifi stops working after some time
  ----------------------------------

  After 10 - 20 min the wifi stops working, losing the connection altogether. Turning wifi off for several minutes and then turning it back on usually works. Might be a thermal issue?


As mentioned, the controller is a BCM43602 - from 'lspci -nn':
  03:00.0 Network controller [0280]: Broadcom Limited BCM43602 802.11ac Wireless LAN SoC [14e4:43ba] (rev 02)
Detailed 'lspci -vvnn' output is attached.

The firmware is the latest, I believe:
-rw-r--r--. 1 root root 595472 Dec  5 08:39 /lib/firmware/brcm/brcmfmac43602-pcie.ap.bin
-rw-r--r--. 1 root root 635449 Dec  5 08:39 /lib/firmware/brcm/brcmfmac43602-pcie.bin
Comment 1 Ronald 2017-01-22 10:20:41 UTC
Created attachment 252771 [details]
Output from 'iw list'
Comment 2 Ronald 2017-01-22 10:21:27 UTC
Created attachment 252781 [details]
Output from 'modinfo brcmfmac'
Comment 3 Ronald 2017-01-22 10:24:36 UTC
Created attachment 252791 [details]
Output from dmesg after building brcmfmac with CONFIG_BRCMDBG=y and setting debug to 0x7fffffff
Comment 4 Daniel Roschka 2017-01-22 11:38:27 UTC
Same issue with MacBookPro13,2 as well (as it's obviously the same wifi chipset ;-)).
Comment 5 Bernhard Froemel 2017-02-24 18:20:22 UTC
Same issues with MacBookPro13,3. Could be firmware related, like on the MBP 2015:

https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/commit/brcm/brcmfmac43602-pcie.bin?id=ea1178515b8852a5ead23b165b4609ef2b49f36c
Comment 6 Daniel Roschka 2017-02-24 21:15:51 UTC
As I assume the same I contacted Arend van Spriel (who works at Broadcom and fixed it last time) a few weeks back with the request to help, but I got no response so far. :-(
Comment 7 Daniel Roschka 2017-04-28 23:32:41 UTC
revinfo shows a different chip revision compared to the chip in the MacBookPro12,1 (https://bugzilla.kernel.org/show_bug.cgi?id=100201#c21), whose proper function got fixed by a firmware update. So still certainly possible that it's something firmware related.

cat /sys/kernel/debug/brcmfmac/0000\:02\:00.0/revinfo

vendorid: 0x14e4
deviceid: 0x4318
radiorev: 0.13.32.105
chipnum: 43602 (aa52)
chiprev: 2
chippkg: 1
corerev: 49
boardid: 0x061b
boardvendor: 0x14e4
boardrev: P421
driverrev: 7.35.177.61
ucoderev: 0
bus: 0
phytype: 11
phyrev: 18
anarev: 0
nvramrev: 00000000
Comment 8 Daniel Roschka 2017-07-26 13:26:06 UTC
Created attachment 257709 [details]
dmesg output of "insmod brcmfmac debug=0xd416" with Linux 4.13-rc1

dmesg output of "insmod brcmfmac debug=0xd416" with Linux 4.13-rc1

During the captured trace multiple tries to connect to one of the Wi-Fi networks in range happened, but failed, even though the AP was only ~1m away. While the MacBookPro in question only detects a few Wi-Fi networks, a random, cheap Android device detects around a dozen.
Comment 9 Arend van Spriel 2017-07-28 22:13:41 UTC
(In reply to Daniel Roschka from comment #8)
> Created attachment 257709 [details]
> dmesg output of "insmod brcmfmac debug=0xd416" with Linux 4.13-rc1

So the dmesg shows:

[29270.808720] brcmfmac: brcmf_cfg80211_reg_notifier Enter: initiator=1, alpha=DE
[29270.809184] brcmfmac: brcmf_fil_iovar_data_get ifidx=0, name=country, len=12
[29270.809186] brcmutil: data
[29270.809189] 00000000: 58 30 00 00 00 00 00 00 58 30 00 ff              X0......X0..
[29270.809192] brcmfmac: brcmf_translate_country_code No country codes configured for device

The country code X0 is apparently stored in the device itself. Now this country needs to be supported by the firmware we released to linux-firmware and my guess is that it does not.
Comment 10 Daniel Roschka 2017-08-04 06:42:57 UTC
@Arend: So how to proceed? Can you provide a firmware with such support?
Comment 11 Luis Castillo 2017-09-01 09:34:41 UTC
Dear @Arend,
Could you make a patch, please? All MacbookPro13 users will be extremely grateful to you.

Many thanks in advance.
All the best,
Luis.
Comment 12 Dmitry Sboychakov 2017-09-01 17:29:41 UTC
Totally agree with @Luis!
@Arend, please make a patch, we all will be very thankful!
If you need any additional/debug info  - just give us a sign)
Comment 13 stefan.langenmaier+kernel 2017-09-07 14:40:38 UTC
The same chip is also in the MacbookPro14,2.
Comment 14 Olli Salo 2017-09-25 17:37:40 UTC
@Arend, one more extra grateful Macbook Pro user here, should you be able to provide us with the firmware. You'd save us from using Macos when we could be using Linux. :D
Comment 15 Diogenes Rettori 2017-10-19 12:59:25 UTC
Aaaand another one here willing to have decent wifi.
Comment 16 Jeff YANG 2017-10-28 08:40:56 UTC
Another 14,2 user, who's loving running Linux kernel on mac, is also expecting this firmware update. Thanks and 谢谢
Comment 17 Slobodan Pejić 2017-11-01 21:26:59 UTC
MacbookPro14,3 is also affected by this issue.
Comment 18 Andrew 2017-11-08 01:15:08 UTC
MacBookPro14,2 with 4.13.10 (fedora 26) also experiencing limited WIFI sensitivity and only wireless-n on BRCM43206 rev2 wireless-AC capable hardware. Please find a fix. 

Firmware installed but this does not fix problem.
https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/plain/brcm/brcmfmac43602-pcie.bin has been installed in /lib/firmware/brcm/ and mac was rebooted. Problem persists.
Comment 19 Satya Arjunan 2018-01-15 01:11:37 UTC
Macbook Pro 14,2 user. Please fix this showstopper bug for the recent Macbook Pros.
Comment 20 Paul Muster 2018-03-07 13:43:53 UTC
Can you please share a timeframe in which you may fix that issue?
This would really help a lot! 

Thanks @Arend!
Comment 21 Craig Errington 2018-04-10 05:56:53 UTC
Is there anything we can do to push this forward? This is essentially the showstopper from running Linux on a pretty wide variety of Apple laptops.
Comment 22 Bernhard Froemel 2018-04-10 06:21:25 UTC
Maybe there are "political reasons" why this is not moving forward? Arend: please do not reply to this bug report with more information if this is the case! :)

On the other hand, if something can be done outside the firmware, any hints or pointers  (other than reverse engineering the OSX drivers) would be highly appreciated!
Comment 23 Olli Salo 2018-04-14 11:40:17 UTC
Hello guys. I was in correspondence with Arend some time ago and got this answer (and permission to post his reply to this forum):

======= snip ==========

The firmware update is not an easy task as it updates regulatory data in firmware it means a full verification cycle is required to assure the power levels stay within regulatory limits. This is always a hard sell for us as there is no return of investment for the engineering costs involved. Hence we release fullmac firmware that has been verified in running projects. Sadly the 43602 in the MacBook does not use a fullmac driver architecture so there is no fullmac firmware available. I have forwarded your request, but no high hopes we can resolve this.

Regards,
Arend

======= snip ===========

I decided to sell my Macbook Pro and started using a Dell laptop instead with Linux working on it like a charm.
Comment 24 Patrick Max 2018-04-16 08:43:03 UTC
Are there any updates?

Is there any workaround?
Comment 25 Andrey Arapov 2018-05-10 21:56:39 UTC
Ok, I am really tired of using a usb wifi dongle, so I was digging a bit deeper and here is what I've got.

Changing ccode=X0 to 0 and regrev=15 to 0 in the firmware seems like improving things a little and makes the connection more usable:

- instantly connecting to the WiFi;
- link quality=70/70 (Max!);
- connections is stable, no disconnects;
- I've got stable 50 Mbps download and 20 Mbps upload (my ISP allows 200/20 Max as per my contract);
- The latency gets higher as I am downloading things, but otherwise it is as low as it should be;
- still no 5GHz ... not sure why, maybe some hints what can be changed in the FW ? I've tried many things already...;


--- 8.8.8.8 ping statistics ---
100 packets transmitted, 100 received, 0% packet loss, time 99154ms
rtt min/avg/max/mdev = 8.548/12.201/70.152/8.757 ms


Here is the FW diff:

# radiff2 -r /lib/firmware/brcm/brcmfmac43602-pcie.bin.orig /lib/firmware/brcm/brcmfmac43602-pcie.bin
wx 3000 @ 0x0007c82f
wx 3000 @ 0x0007c839

# radiff2 -x /lib/firmware/brcm/brcmfmac43602-pcie.bin.orig /lib/firmware/brcm/brcmfmac43602-pcie.bin
  offset     0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF    0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
0x00000000  80f140b882f1a4b982f1b0b982f1bcb9 ..@.............   80f140b882f1a4b982f1b0b982f1bcb9 ..@.............
0x00000010  82f1cbb982f1dab982f1e9b982f1f8b9 ................   82f1cbb982f1dab982f1e9b982f1f8b9 ................
...
0x0007c820! 30643a66343a33650063636f64653d58 0d:f4:3e.ccode=X   30643a66343a33650063636f64653d30 0d:f4:3e.ccode=0
0x0007c830! 30007265677265763d31350061613267 0.regrev=15.aa2g   00007265677265763d30000061613267 ..regrev=0..aa2g
0x0007c840  3d3700616135673d370061676267303d =7.aa5g=7.agbg0=   3d3700616135673d370061676267303d =7.aa5g=7.agbg0=
0x0007c850  37310061676267313d37310061676267 71.agbg1=71.agbg   37310061676267313d37310061676267 71.agbg1=71.agbg
...


HW: MacBookPro14,3
Linux kernel: 4.16.8
WiFi card: Broadcom Limited BCM43602 802.11ac Wireless LAN SoC (rev 02)

Hope that workaround helps someone, until we get a proper FW, or a non-Apple replacement, finally :-)

Kind regards,
Andrey Arapov
Comment 26 Andrey Arapov 2018-05-11 11:24:26 UTC
Switching the txpower from 31 dBm down to 10 dBm (iwconfig wlp3s0 txpower 10dBm) appears to be also helping even with the non-modified FW.

I have also found the following posts which are still valid https://bugzilla.kernel.org/show_bug.cgi?id=103201

> Adrian Bjugård 2015-09-02 11:57:39 UTC:

> Also 5 GHz doesn't work, and the correct physical MAC address isn't
> recognised properly, everyone with this card (14e4:43ba) gets assigned the
> MAC address 00:90:4c:0d:f4:3e. Even by spoofing MAC address, it isn't
> possible to have two users of this card in the vicinity of each other.


> Arend van Spriel 2015-09-05 13:15:05 UTC:

> This issue has been root caused as a firmware issue. We are preparing a new
> firmware release to linux-firmware repo.

I am wondering whether we could extract the necessary FW from macOS, anyone has any pointers?

Kind regards,
Andrey Arapov
Comment 27 Ronald 2018-05-13 00:41:15 UTC
This is very interesting! I played around with the ccode and regrev values a bit, and it looks like the ccode modification isn't necessary: just changing the regrev to any single-digit value is enough. Also, in the `strings` output I saw 'ccode=%c%c' so I'm thinking the ccode, if modified, should probably be set to something like 'US' rather than a number.

Secondly, the interface still isn't very stable for me: it seems to get stuck very often (e.g. a download will proceed in bursts), and (probably as a consequence) it ends up dropping the wireless connection every now and then.

As to using the FW from MacOS, I strongly doubt that'll work - the FW's tend to be very different for different OS'.
Comment 28 jacooba9 2018-05-24 20:17:12 UTC
Hi! I'm new here, but I was wondering if someone could tell me the location of the firmware file I need to edit to get wifi working.

It seems like the easiest fix is either to change regrev in the firmware, or to just lower the tx-power to 10. Do I need to do both? Which is better? (And how can I tell?)

Thank you!
Comment 29 Alex Kennedy 2018-05-25 06:43:46 UTC
A(In reply to Arend van Spriel from comment #9)
> [29270.808720] brcmfmac: brcmf_cfg80211_reg_notifier Enter: initiator=1,
> alpha=DE
> [29270.809184] brcmfmac: brcmf_fil_iovar_data_get ifidx=0, name=country,
> len=12
> [29270.809186] brcmutil: data
> [29270.809189] 00000000: 58 30 00 00 00 00 00 00 58 30 00 ff             
> X0......X0..
> [29270.809192] brcmfmac: brcmf_translate_country_code No country codes
> configured for device
> 
> The country code X0 is apparently stored in the device itself. Now this
> country needs to be supported by the firmware we released to linux-firmware
> and my guess is that it does not.

Hey Arend,

Thank you so much for this example and explanation. I just wanted to add my plea of help to this bug as well, although I am sure you have been fighting for us as best you can.

Thank you!
Comment 30 Ronald 2018-05-25 06:56:39 UTC
The full path of the firmware file in question is: /lib/firmware/brcm/brcmfmac43602-pcie.bin . As to regrev vs power vs both: try them out for yourself and report back here.
Comment 31 Satya Arjunan 2018-05-25 08:25:28 UTC
Created attachment 276179 [details]
attachment-17819-0.html

I can confirm Andrey's workaround to set ccode=X0 to 0 and regrev=15 to 0
in the firmware gives stable connection.
The other option, "sudo iwconfig wlp2s0 txpower 10dBm" works well too with
the original firmware.

HW: MacBookPro14,2
Kernel: 4.15.0-22-generic

Satya

On 11 May 2018 at 06:56, <bugzilla-daemon@bugzilla.kernel.org> wrote:

> https://bugzilla.kernel.org/show_bug.cgi?id=193121
>
> Andrey Arapov (andrey.arapov@nixaid.com) changed:
>
>            What    |Removed                     |Added
> ------------------------------------------------------------
> ----------------
>                  CC|                            |andrey.arapov@nixaid.com
>
> --- Comment #25 from Andrey Arapov (andrey.arapov@nixaid.com) ---
> Ok, I am really tired of using a usb wifi dongle, so I was digging a bit
> deeper
> and here is what I've got.
>
> Changing ccode=X0 to 0 and regrev=15 to 0 in the firmware seems like
> improving
> things a little and makes the connection more usable:
>
> - instantly connecting to the WiFi;
> - link quality=70/70 (Max!);
> - connections is stable, no disconnects;
> - I've got stable 50 Mbps download and 20 Mbps upload (my ISP allows
> 200/20 Max
> as per my contract);
> - The latency gets higher as I am downloading things, but otherwise it is
> as
> low as it should be;
> - still no 5GHz ... not sure why, maybe some hints what can be changed in
> the
> FW ? I've tried many things already...;
>
>
> --- 8.8.8.8 ping statistics ---
> 100 packets transmitted, 100 received, 0% packet loss, time 99154ms
> rtt min/avg/max/mdev = 8.548/12.201/70.152/8.757 ms
>
>
> Here is the FW diff:
>
> # radiff2 -r /lib/firmware/brcm/brcmfmac43602-pcie.bin.orig
> /lib/firmware/brcm/brcmfmac43602-pcie.bin
> wx 3000 @ 0x0007c82f
> wx 3000 @ 0x0007c839
>
> # radiff2 -x /lib/firmware/brcm/brcmfmac43602-pcie.bin.orig
> /lib/firmware/brcm/brcmfmac43602-pcie.bin
>   offset     0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF    0 1 2 3 4
> 5 6
> 7 8 9 A B C D E F 0123456789ABCDEF
> 0x00000000  80f140b882f1a4b982f1b0b982f1bcb9 ..@.............
> 80f140b882f1a4b982f1b0b982f1bcb9 ..@.............
> 0x00000010  82f1cbb982f1dab982f1e9b982f1f8b9 ................
> 82f1cbb982f1dab982f1e9b982f1f8b9 ................
> ...
> 0x0007c820! 30643a66343a33650063636f64653d58 0d:f4:3e.ccode=X
> 30643a66343a33650063636f64653d30 0d:f4:3e.ccode=0
> 0x0007c830! 30007265677265763d31350061613267 0.regrev=15.aa2g
> 00007265677265763d30000061613267 ..regrev=0..aa2g
> 0x0007c840  3d3700616135673d370061676267303d =7.aa5g=7.agbg0=
> 3d3700616135673d370061676267303d =7.aa5g=7.agbg0=
> 0x0007c850  37310061676267313d37310061676267 71.agbg1=71.agbg
> 37310061676267313d37310061676267 71.agbg1=71.agbg
> ...
>
>
> HW: MacBookPro14,3
> Linux kernel: 4.16.8
> WiFi card: Broadcom Limited BCM43602 802.11ac Wireless LAN SoC (rev 02)
>
> Hope that workaround helps someone, until we get a proper FW, or a
> non-Apple
> replacement, finally :-)
>
> Kind regards,
> Andrey Arapov
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
>
Comment 32 jacooba9 2018-06-05 18:40:16 UTC
When try to open /lib/firmware/brcm/brcmfmac43602-pcie.bin in vim, it appears to be gibberish. Am I doing something wrong? Is this the right file? Is there another way to edit .bin files? Never done this before. Any guidance would be appreciated! Thanks!
Comment 33 Ronald 2018-06-05 21:35:14 UTC
(In reply to jacooba9 from comment #32)
> When try to open /lib/firmware/brcm/brcmfmac43602-pcie.bin in vim, it
> appears to be gibberish. Am I doing something wrong? Is this the right file?
> Is there another way to edit .bin files? Never done this before. Any
> guidance would be appreciated! Thanks!

You want to use an editor capable of handling binary files: one such editor is 'bvi'.
Comment 34 jacooba9 2018-06-05 21:39:35 UTC
Thanks, Ill give that a try!
Comment 35 alex.zerah 2018-06-11 14:22:16 UTC
Hi everyone, i just installed ubuntu 18.04 on my macbook pro 15" 2017 with touchbar. I try "bvi /lib/firmware/brcm/brcmfmac43602-pcie.bin.orig" in the terminal but the file seems empty. I don't  what to do.
Comment 36 LF Chen 2018-06-11 14:38:36 UTC
(In reply to alex.zerah from comment #35)
> Hi everyone, i just installed ubuntu 18.04 on my macbook pro 15" 2017 with
> touchbar. I try "bvi /lib/firmware/brcm/brcmfmac43602-pcie.bin.orig" in the
> terminal but the file seems empty. I don't  what to do.


The driver doesn't have the '.orig' extension, it is just named "brcmfmac43602-pcie.bin". And the '.orig' is used to back up the original driver.
Comment 37 mcgi5sr2 2018-06-11 16:11:14 UTC
Has anyone tried changing the country code to US or another country code. We had a similar issue with broadcom chips on Sony android devices that were only detecting 2.4Ghz networks that was resolved by setting a real country code. Unfortunately I am not in a position to test it for the firmware here but would certainly think it worth attempting.

https://review.carbonrom.org/#/c/6681/1/configs/wifi/bcmdhd.cal

I believe that 00 is the code for `world` a brief google isn't showing me the list I would hope for though
Comment 38 Martin Ghosal 2018-06-16 22:15:27 UTC
attempted to change X0 to 00 and it did not work out. all networking features have gone down now
Comment 39 JR Boyens 2018-06-25 08:24:22 UTC
I've done a bit of work in this area, but really to no avail.

I've ccode=0,regrev=0 works the best, but it isn't great. ccode=XV,regrev=1 has a stronger signal for me, but still has significant drop-out problems. I tried as many combos as I could as well as checking the macOS and Windows drivers/firmwares for specific pieces that may work.

I have not been able to get 5Ghz channels to activate no matter what I've chosen.
Comment 40 Ben Walsh 2018-06-25 08:55:04 UTC
FWIW I've seen problems with the wifi of this machine when running Windows 10 on it installed through BootCamp - problems I've never had when running Mac OS X against the exact same wifi router at almost the same times. I'll document the problems more fully if it'll be useful. Given Apple appear to have thrown considerable weight behind users running Windows on this hardware, perhaps pushing for fixes to problems which can be also be demonstrated under Windows will have more success, while also fixing the problems on Linux.
Comment 41 jakeabeck 2018-06-29 15:49:13 UTC
It would be a big help if someone could post the modified binary file with regrev=0 and ccode=0 (or whatever you have working). If you cant upload the file, could you just open it in sublime and post the text encoding? I’m really struggling with editing the file and getting it to work at all. Please and thank you!
Comment 42 jacooba9 2018-06-30 03:08:22 UTC
the code with regrev=0 and ccode=0  is strictly worse for me: wouldn't connect at all (regardless of the tx-power). 

Anyone have this happen and find a solution?
Comment 43 David Mortals 2018-07-03 03:08:57 UTC
Thanks, FYI, "sudo iwconfig wlp2s0 txpower 10dBm" works well (2.4G only) with
the original firmware (Ubuntu 18.04 + v4.17 custom build kernel) on MacBook Pro 2018 with touchbar.
Comment 44 Aleksei Nosachev 2018-07-04 20:07:45 UTC
In Dell's reddit community to avoid BSODs people are encouraged using a bit more fresh firmware. Tried it already, but seems like it have some differences in init/settings with the linux one. Maybe it is possible to copy only the proprietary part of it.
Currently used version: 7.35.177.61 (r598657) FWID 01-ea662a8c
Attached version: 7.35.240.55 (r609579) FWID 01-89725025
https://www.dell.com/support/home/us/en/04/Drivers/DriversDetails?driverId=JKRJ9
The firmware itself resides in Drivers/WinThresh/WL/x64/43602a1rtecdc.bin
Comment 45 VA 2018-07-10 12:39:49 UTC
Not working with the default value of 31 dBm at home, I have to set it to either 10 or 11 dBm.
At work, where the AP signal strength is poor, it works with the default 31 dBm and only close to AP.
May it be like the driver's number-to-signalstrength value is not linear to real dBm?
Comment 46 sxnguyen 2018-08-19 06:52:25 UTC
Andrey,
Thank you for your works on this.  It seems like it works out well for you... However, when I change my ccode to 0 and regrev to 15 wifi does not start.  Some other people on this thread also reported the same issue.  I can only lower the txpower as the work-around.  However, I cannot connect to most of the wifi as it is too weak.  I really want to get your work-around (modifying the firmware) to work.
Do you have any ideas?
I'm using 
HW: MacBookPro14,3
Linux kernel: 4.17.x (Fedora 28)
WiFi card: Broadcom Limited BCM43602 802.11ac Wireless LAN SoC (rev 02)
Thank you again.


(In reply to Andrey Arapov from comment #25)
> Ok, I am really tired of using a usb wifi dongle, so I was digging a bit
> deeper and here is what I've got.
> 
> Changing ccode=X0 to 0 and regrev=15 to 0 in the firmware seems like
> improving things a little and makes the connection more usable:
> 
> - instantly connecting to the WiFi;
> - link quality=70/70 (Max!);
> - connections is stable, no disconnects;
> - I've got stable 50 Mbps download and 20 Mbps upload (my ISP allows 200/20
> Max as per my contract);
> - The latency gets higher as I am downloading things, but otherwise it is as
> low as it should be;
> - still no 5GHz ... not sure why, maybe some hints what can be changed in
> the FW ? I've tried many things already...;
> 
> 
> --- 8.8.8.8 ping statistics ---
> 100 packets transmitted, 100 received, 0% packet loss, time 99154ms
> rtt min/avg/max/mdev = 8.548/12.201/70.152/8.757 ms
> 
> 
> Here is the FW diff:
> 
> # radiff2 -r /lib/firmware/brcm/brcmfmac43602-pcie.bin.orig
> /lib/firmware/brcm/brcmfmac43602-pcie.bin
> wx 3000 @ 0x0007c82f
> wx 3000 @ 0x0007c839
> 
> # radiff2 -x /lib/firmware/brcm/brcmfmac43602-pcie.bin.orig
> /lib/firmware/brcm/brcmfmac43602-pcie.bin
>   offset     0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF    0 1 2 3 4 5
> 6 7 8 9 A B C D E F 0123456789ABCDEF
> 0x00000000  80f140b882f1a4b982f1b0b982f1bcb9 ..@.............  
> 80f140b882f1a4b982f1b0b982f1bcb9 ..@.............
> 0x00000010  82f1cbb982f1dab982f1e9b982f1f8b9 ................  
> 82f1cbb982f1dab982f1e9b982f1f8b9 ................
> ...
> 0x0007c820! 30643a66343a33650063636f64653d58 0d:f4:3e.ccode=X  
> 30643a66343a33650063636f64653d30 0d:f4:3e.ccode=0
> 0x0007c830! 30007265677265763d31350061613267 0.regrev=15.aa2g  
> 00007265677265763d30000061613267 ..regrev=0..aa2g
> 0x0007c840  3d3700616135673d370061676267303d =7.aa5g=7.agbg0=  
> 3d3700616135673d370061676267303d =7.aa5g=7.agbg0=
> 0x0007c850  37310061676267313d37310061676267 71.agbg1=71.agbg  
> 37310061676267313d37310061676267 71.agbg1=71.agbg
> ...
> 
> 
> HW: MacBookPro14,3
> Linux kernel: 4.16.8
> WiFi card: Broadcom Limited BCM43602 802.11ac Wireless LAN SoC (rev 02)
> 
> Hope that workaround helps someone, until we get a proper FW, or a non-Apple
> replacement, finally :-)
> 
> Kind regards,
> Andrey Arapov
Comment 47 Brian Tarricone 2018-08-29 00:36:59 UTC
I've had a bit more luck with this.

I was a little baffled by the fact that I could see some of my neighbors' 5GHz networks, but not mine.  Output of `sudo iw list | grep -A 15 Frequencies:` gives me a bunch of 5GHz channels, though fewer than I'd expect.

My router was set to automatically pick a channel, and happened to pick something (5580 MHz) not in the list the driver was reporting as supported.  So I manually forced my router to something in the range listed as supported by the driver, and now I can successfully connect to my 5GHz network.

I imagine regulatory domain does matter, so perhaps also ensure that 'crda' is installed, and then you can `iw reg get` and `iw reg set $COUNTRY_CODE` to set yours properly.

For reference, I'm running Debian buster with their stock 4.17.17-1 kernel, with firmware-brcm8-20180518-1 installed.
Comment 48 Brian Tarricone 2018-08-29 00:38:47 UTC
Actually -- and sorry for the noise -- I just had my grep command not printing out everything it should have been printing out, so the higher frequencies are indeed listed by the driver.

But still, maybe despite what the driver supports, it's still having trouble working with some frequencies, so I'd suggest playing around with the channel on the AP.
Comment 49 sxnguyen 2018-09-03 19:47:14 UTC
I found the issue I had with modifying the firmware directly.  I need to change the ccode from X0 to 0. and regrev from 15 to 0. 
So the string would look like this:
=========
ccode=0..regrev=0..aa2g
=========
Once I reboot, I can connect to my wifi without using "sudo iwconfig <> txpower 10dbm" anymore.

My link quality sadly is not 70/70 like Andrey reported. 

I hope this helps someone who wants to modify the firmware directly..

Regards,

(In reply to sxnguyen from comment #46)
> Andrey,
> Thank you for your works on this.  It seems like it works out well for
> you... However, when I change my ccode to 0 and regrev to 15 wifi does not
> start.  Some other people on this thread also reported the same issue.  I
> can only lower the txpower as the work-around.  However, I cannot connect to
> most of the wifi as it is too weak.  I really want to get your work-around
> (modifying the firmware) to work.
> Do you have any ideas?
> I'm using 
> HW: MacBookPro14,3
> Linux kernel: 4.17.x (Fedora 28)
> WiFi card: Broadcom Limited BCM43602 802.11ac Wireless LAN SoC (rev 02)
> Thank you again.
> 
> 
> (In reply to Andrey Arapov from comment #25)
> > Ok, I am really tired of using a usb wifi dongle, so I was digging a bit
> > deeper and here is what I've got.
> > 
> > Changing ccode=X0 to 0 and regrev=15 to 0 in the firmware seems like
> > improving things a little and makes the connection more usable:
> > 
> > - instantly connecting to the WiFi;
> > - link quality=70/70 (Max!);
> > - connections is stable, no disconnects;
> > - I've got stable 50 Mbps download and 20 Mbps upload (my ISP allows 200/20
> > Max as per my contract);
> > - The latency gets higher as I am downloading things, but otherwise it is
> as
> > low as it should be;
> > - still no 5GHz ... not sure why, maybe some hints what can be changed in
> > the FW ? I've tried many things already...;
> > 
> > 
> > --- 8.8.8.8 ping statistics ---
> > 100 packets transmitted, 100 received, 0% packet loss, time 99154ms
> > rtt min/avg/max/mdev = 8.548/12.201/70.152/8.757 ms
> > 
> > 
> > Here is the FW diff:
> > 
> > # radiff2 -r /lib/firmware/brcm/brcmfmac43602-pcie.bin.orig
> > /lib/firmware/brcm/brcmfmac43602-pcie.bin
> > wx 3000 @ 0x0007c82f
> > wx 3000 @ 0x0007c839
> > 
> > # radiff2 -x /lib/firmware/brcm/brcmfmac43602-pcie.bin.orig
> > /lib/firmware/brcm/brcmfmac43602-pcie.bin
> >   offset     0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF    0 1 2 3 4
> 5
> > 6 7 8 9 A B C D E F 0123456789ABCDEF
> > 0x00000000  80f140b882f1a4b982f1b0b982f1bcb9 ..@.............  
> > 80f140b882f1a4b982f1b0b982f1bcb9 ..@.............
> > 0x00000010  82f1cbb982f1dab982f1e9b982f1f8b9 ................  
> > 82f1cbb982f1dab982f1e9b982f1f8b9 ................
> > ...
> > 0x0007c820! 30643a66343a33650063636f64653d58 0d:f4:3e.ccode=X  
> > 30643a66343a33650063636f64653d30 0d:f4:3e.ccode=0
> > 0x0007c830! 30007265677265763d31350061613267 0.regrev=15.aa2g  
> > 00007265677265763d30000061613267 ..regrev=0..aa2g
> > 0x0007c840  3d3700616135673d370061676267303d =7.aa5g=7.agbg0=  
> > 3d3700616135673d370061676267303d =7.aa5g=7.agbg0=
> > 0x0007c850  37310061676267313d37310061676267 71.agbg1=71.agbg  
> > 37310061676267313d37310061676267 71.agbg1=71.agbg
> > ...
> > 
> > 
> > HW: MacBookPro14,3
> > Linux kernel: 4.16.8
> > WiFi card: Broadcom Limited BCM43602 802.11ac Wireless LAN SoC (rev 02)
> > 
> > Hope that workaround helps someone, until we get a proper FW, or a
> non-Apple
> > replacement, finally :-)
> > 
> > Kind regards,
> > Andrey Arapov
Comment 50 Rasmus 2018-11-15 08:27:20 UTC
With ccode and regrev set to 0 I can see some networks, with ccode set to EU and regrev to 66 I think I can see all 2.4GHz networks. However, still with a very weak signal and changing txpower does nothing to fix that.
I also can't get 5GHz to work at all.

Is it possible to extract some usable things from the Windows driver?
If I remember correctly there was a project to support Windows wifi drivers a long time ago.

Note You need to log in before you can comment on or make changes to this bug.