mbp-2016-linux icon indicating copy to clipboard operation
mbp-2016-linux copied to clipboard

BCM43602 WiFi issues

Open ghost opened this issue 7 years ago • 68 comments

https://bugzilla.kernel.org/show_bug.cgi?id=193121#c9

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.

As far as I see this man has fixed several of these issues already, does someone know if resolving these 13.2 wifi issues is on the horizon as well? Like is there something that could motivate him to do this or is it a gamble?

ghost avatar Dec 23 '17 15:12 ghost

All infos we got are in the Bugzilla thread. Sadly we didn't get any further response from Broadcom. šŸ˜ž My guess is that it would be pretty easy for them to fix, but isn't on their list of priorities right now.

Dunedan avatar Dec 23 '17 15:12 Dunedan

My guess is that it would be pretty easy for them to fix, but isn't on their list of priorities right now.

I'd interpret his statement the same

didn't get any further response from Broadcom. šŸ˜ž

okay šŸ˜žšŸ˜ž

ghost avatar Dec 26 '17 18:12 ghost

From the bugzilla link:

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.

ghost avatar Apr 23 '18 18:04 ghost

I'm running ubuntu 16.04 LTS on a MacBook Pro 2017 13,2 (without Touch Bar), kernel 4.16 . The wifi is working perfectly, I only remastered the kernel with the keyboard drivers. I'm a noob when it comes to tinkering the kernel, but if I can get any information from my system or contribute in some other way that might help just let me know.

tomas-ramos21 avatar Apr 25 '18 16:04 tomas-ramos21

so my WiFi Card reports as:

AirPort Extreme  (0x14E4, 0x157)
Broadcom BCM43xx 1.0 (7.77.37.29.1a7)

I've got a 13.2 with touchbar actually

Maybe I'll have to try to boot from external media and see how it works with 4.16.

ghost avatar Apr 25 '18 16:04 ghost

@tumra86 Wifi in the models without Touch Bar isn't an issue at all and is known to work fine. It's only a problem for the Touch Bar models.

Dunedan avatar Apr 25 '18 17:04 Dunedan

Based on the recent development in the Bugzilla issue, which got already quoted here, I think we should start looking in other directions to get rid of this problem. As macOS apparently doesn't have any problem, can we maybe use the firmware Apple uses or can we think of some kind of driver-side workaround?

Dunedan avatar Apr 25 '18 19:04 Dunedan

If there was a USB C Wifi stick I'd be ok with that as well. The sort of stick that barely protrudes. I have not found such a thing for USB C yet though.

ghost avatar May 08 '18 20:05 ghost

I use one of these: https://www.canakit.com/raspberry-pi-wifi.html with a USB-C adapter.

Small and seems to work well enough.

jboyens avatar May 08 '18 21:05 jboyens

https://bugzilla.kernel.org/show_bug.cgi?id=193121#c25

(there's a diff in the thread)

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...

craigerrington avatar May 10 '18 22:05 craigerrington

I can confirm that this "patch" enables the 14,3 to connect and hold a WiFi signal.

jboyens avatar May 11 '18 05:05 jboyens

Make no mistake. It's slow. REALLY slow. With the Canakit dongle (not a great one by any means) I can get 50mbit up/50mbit down. With brcmfmac I get 3mbit up/20mbit down. Removing and reinserting the kernel module does not activate the device properly. A reboot is required.

A step in the right direction...

jboyens avatar May 11 '18 05:05 jboyens

It's a step in the right direction, but still generally not great:

--- www.google.com ping statistics ---
564 packets transmitted, 408 received, +1 duplicates, 27% packet loss, time 567305ms
rtt min/avg/max/mdev = 12.525/1973.478/11679.836/3011.685 ms, pipe 12

ClashTheBunny avatar May 14 '18 11:05 ClashTheBunny

I can confirm that this "patch" enables the 14,3 to connect and hold a signal.

Could you elaborate on how to change regrev and ccode in the brcmfmac firmware? I am not really experienced on kernel and firmware topics. It would be great to get some advice ;) /lib/firmware/brcm/ are all binaries. How would I change them?

m0oz avatar May 15 '18 06:05 m0oz

@m0oz Personally I use bvi (binary vi) for this sort of thing,

roadrunner2 avatar May 25 '18 06:05 roadrunner2

Messing with this again tonight. I get a strong (full signal) 2.4Ghz connection with ccode=XV regrev=1. I haven't yet tried in a less forgiving environment, but it seems more solid.

I'm continuing to iterate to figure out if I can get 5Ghz to kick over.

I checked out the Windows drivers, but no joy (they have no values for this bits encoded)

jboyens avatar Jun 21 '18 05:06 jboyens

So I finally tried out the binary patching workarounds and I'm pretty disappointed. While it's definitely a step into the right direction, it's still not usable for me. Packet loss and general connection speed are awful.

To make it easier to try it out yourself, here are a step by step instructions to patch the firmware:

  • Make a backup of your original firmware to a new location (as it'll be modified directly):
cp -a /lib/firmware/brcm/brcmfmac43602-pcie.bin /lib/firmware/brcm/brcmfmac43602-pcie.bin.orig
  • install radare2
  • create a rapatch-patch file with the following content:
0x0007c82f "wx 3000"
0x0007c839 "wx 3000"
  • Patch the firmware using the following command:
radare2 -w -q -P your_patch_file brcmfmac43602-pcie.bin
  • Verify the file got correctly patched, by showing the diff between the original file and your patched file:
radiff2 -x brcmfmac43602-pcie.bin.orig brcmfmac43602-pcie.bin
  • Reboot your MacBook Pro

Dunedan avatar Jul 01 '18 08:07 Dunedan

I just wanted to say I'm really happy to see that there's some groundwork going, but still quite unhappy that it's so unstable. Thanks everyone for the work on this and I'll be watching this thread hoping to see some updates in the future.

tim-digitised avatar Jul 19 '18 21:07 tim-digitised

I was thinking. Why don't we make a bounty? The dev that actually patches at least wifi or wifi and audio will get this.

mkexc avatar Oct 07 '18 16:10 mkexc

If that bounty was set up as a pool that community members could contribute to (i.e. contribute $0-20 or as much as each person could contribute) I would definitely contribute to that pool.

heywoodlh avatar Oct 07 '18 20:10 heywoodlh

I'm afraid a bounty wouldn't change the situation, as this problem needs to get fixed by Broadcom and as already stated by a Broadcom employee, there is little hope they consider that important enough. I'm pretty certain a few hundred bucks wouldn't change their mind, especially as the cost of engineering and re-certification would be probably still way higher.

I see only one possibility to get out of this situation right now: Get enough people to tell Broadcom that this is an important problem for them. It's quite a difference if a few dozen people have this problem or a few thousand. That of course would require that many affected people and I'm afraid there are fewer than that wanting to use these MacBook Pro's with Linux. :disappointed:

Dunedan avatar Oct 12 '18 19:10 Dunedan

Forgive me if these is questions are "silly" (I don't have the best understanding of the certification and regulation that applies to WiFi drivers/firmware), but if Broadcom needed to update the firmware for some other reasons (and thus require re-certification) is it likely that they would try to get a fix for this bug included with the (hypothetical) new firmware? Or does this bug itself require a costly fix, on top of recertification costs? Also, would Broadcom be able to provide a fix but with an added disclaimer that it hasn't undergone as rigorous testing an certification than their other firmware - or could this lead to legal issues due to not having ensured that the power levels are within the regulatory limits?

ethansherriff avatar Oct 12 '18 22:10 ethansherriff

There are no silly questions, but some questions can probably be only answered by Broadcom.

but if Broadcom needed to update the firmware for some other reasons (and thus require re-certification) is it likely that they would try to get a fix for this bug included with the (hypothetical) new firmware?

I would hope so, but no indea if they really would.

Or does this bug itself require a costly fix, on top of recertification costs?

Nobody outside of Broadcom knows for sure, but my gut feeling is, that the bug fix itself would be straight forward.

Also, would Broadcom be able to provide a fix but with an added disclaimer that it hasn't undergone as rigorous testing an certification than their other firmware - or could this lead to legal issues due to not having ensured that the power levels are within the regulatory limits?

Legal issues is the key here: Such certifications are necessary to be allowed to ship such products (or in this case firmware version) to market.

I guess if Broadcom wouldn't have to re-certificate firmware version after changes, they would've already fixed this bug and shipped a fixed firmware version.

Dunedan avatar Oct 13 '18 05:10 Dunedan

So I installed Ubuntu 18.04 last week and Wifi was working on my 2017 13inch (2 thunderbolt) fine.

I now upgraded to 18.10 with linux kernel 4.18.0-10-generic and the wifi adapter is not recognized.

Any ideas?

tomaytotomato avatar Oct 23 '18 16:10 tomaytotomato

Hey guys, thanks for all your work and research into this. I'm new to Linux and I just dual booted my 2016 MacBook Pro (I believe 13,2) with Touchbar with a Ubuntu Kernel 4.15.0. Initially, my WiFi was only showing 4-5 networks. Apparently my MBP was only detecting 2,4 GHz channels 1-11. After change ccode=0 and regrev=0 as suggested above, I am now seeing channels 12 and 13 also enabled. Channel 14 still says disabled. My home WiFi is now working as I was able to change my WiFi AP settings to only use a channel within the range my MBP currently supports. But this is obviously not a final solution as I can't ask everyone to change their WiFi setting just for me. I'll definitely be watching this thread with the hope of future updates. In the meantime, does anyone have any other suggestions?

FabianVolkers avatar Nov 15 '18 21:11 FabianVolkers

Kernel 4.19 (supposedly) added support for a bunch of 802.11ac chipsets that I'm digging into to find a small-ish wifi adapter solution. Some of the ones I've seen and currently use are a little big and cumbersome. Either way, expect to live the "dongle-life" to the extreme if you want to run Linux on this laptop. There exist 0 USB-C WiFi adapters, so it's even bigger with a USB-A -> USB-C dongle.

jboyens avatar Nov 15 '18 22:11 jboyens

Hi Fabian, try upgrading your kernel to a newer version? That worked for me on a 13,1 MacBook

On Thu, 15 Nov 2018, 21:28 Fabian Volkers <[email protected] wrote:

Hey guys, thanks for all your work and research into this. I'm new to Linux and I just dual booted my 2016 MacBook Pro (I believe 13,2) with Touchbar with a Ubuntu Kernel 4.15.0. Initially, my WiFi was only showing 4-5 networks. Apparently my MBP was only detecting 2,4 GHz channels 1-11. After change ccode=0 and regrev=0 as suggested above, I am now seeing channels 12 and 13 also enabled. Channel 14 still says disabled. My home WiFi is now working as I was able to change my WiFi AP settings to only use a channel within the range my MBP currently supports. But this is obviously not a final solution as I can't ask everyone to change their WiFi setting just for me. I'll definitely be watching this thread with the hope of future updates. In the meantime, does anyone have any other suggestions?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Dunedan/mbp-2016-linux/issues/47#issuecomment-439196546, or mute the thread https://github.com/notifications/unsubscribe-auth/AA7TsSzdoIT_n18lDBpYUXAkbVt6Axmqks5uvdyGgaJpZM4RLsI3 .

tomaytotomato avatar Nov 15 '18 22:11 tomaytotomato

Hi tomaytotomato, thanks for the tip. Unfortunately the WiFi issues still persist after updating to kernel 4.19.2

FabianVolkers avatar Nov 16 '18 10:11 FabianVolkers

@tomaytotomato The MacBook Pros without Touch Bar (like your 13,1) contain a different Wifi chip than the models with Touch Bar. The one in the models without Touch Bar works fine, the one in the models without Touch Bar doesn't. That was already stated in this issue, as well as in the README, so please read past comments to avoid such unnecessary comments.

Dunedan avatar Nov 17 '18 08:11 Dunedan

I just stumbled over nexmon:

The C-based Firmware Patching Framework for Broadcom/Cypress WiFi Chips that enables Monitor Mode, Frame Injection and much more

Could be an approach to produce functioning firmware patches, which fix all issue we're facing. In case somebody wants to get his hands dirty.

Dunedan avatar Dec 31 '18 12:12 Dunedan

I personally find the iwconfig wlp3s0 txpower 10 (or even txpower 1) works very well and results in a stable connection (14,3) Anyone know how to do that automatically at startup ? I'm on debian 10, and so impressed with the work you guys are doing I'm considering of switching to debian as my primary system. Typing the command at startup each time is frustrating though. I passed a command in crontab as root but this is either not being run (crontab service is running) with @reboot iwconfig wlp3s0 txpower 10 but it isn't working. Maybe wifi settings are overridden by users? Anyone have ideas or already solved this? I guess a Debian solution will apply to Ubuntu too.

marc-git avatar Jul 30 '19 07:07 marc-git

P.S.: It is my experience that the bluetooth and wifi interfere. I disabled mine at startup using : gsettings set org.blueman.plugins.powermanager auto-power-on false (not sudo) which allows me to re-enable using blueman.

marc-git avatar Jul 30 '19 08:07 marc-git

For Debian (and Ubuntu) I will look for a ifupdown script (in /etc/network).

jgmbenoit avatar Jul 30 '19 08:07 jgmbenoit

According to the latest posts from the original discussion, just a few days a go someone managed to set the correct parameters for the driver in order to make WiFi 5GHz work with mbp 13.2 and 13.3:

  1. Download this file.
  2. Open it with a text editor and set the mac address line with your own card's address.
  3. Place it in /lib/firmware/brcm.

I tried it and it works with my 13.3 in a Manjaro live USB. Haven't installed it yet, so I can't provide a review for long-term use, though.

liberostelios avatar Nov 09 '19 14:11 liberostelios

According to the latest posts from the original discussion, just a few days a go someone managed to set the correct parameters for the driver in order to make WiFi 5GHz work with mbp 13.2 and 13.3:

  1. Download this file.
  2. Open it with a text editor and set the mac address line with your own card's address.
  3. Place it in /lib/firmware/brcm.

I tried it and it works with my 13.3 in a Manjaro live USB. Haven't installed it yet, so I can't provide a review for long-term use, though.

Trying right now on Ubuntu 19.10 installed on internal SSD. Will update with news soon.

EDIT: Can confirm that it works!!! 5GHz network connected and it's also fast(and stable)!(Not as good as on macOS tho, on macOS i got ā‰ƒ 900+Mbps, on Ubuntu i got ā‰ƒ 300+Mbps). Tested on 13.3, Ubuntu 19.10 stock kernel.

@Dunedan, you can further test this if needed and eventually add to the README.

mkexc avatar Nov 09 '19 14:11 mkexc

According to the latest posts from the original discussion, Ref to comment: https://bugzilla.kernel.org/show_bug.cgi?id=193121#c52

marc-git avatar Nov 09 '19 15:11 marc-git

OK I am posting this over my 5GHz connection. That was quick. I am on MBP14,3 Note the mac address in the firmware is 00:90:4c:0d:f4:3e for all devices. And this works fine for me. @Dunedan is it worth updating the main page for this?

marc-git avatar Nov 09 '19 15:11 marc-git

@marc-git As I already mentioned in bugzilla that's not yet a complete solution. I did some tests and connecting to nearby 2.4Ghz access points (no matter if they use encryption or not) simply doesn't work for me with the latest changes applied. 5Ghz works fine so far though.

Dunedan avatar Nov 10 '19 17:11 Dunedan

@marc-git As I already mentioned in bugzilla that's not yet a complete solution. I did some tests and connecting to nearby 2.4Ghz access points (no matter if they use encryption or not) simply doesn't work for me with the latest changes applied. 5Ghz works fine so far though.

This is working fine for me. I had been doing sudo iwconfig wlp3s0 txpower 10 for a while and could only get 2.4GHz networks, but that was quite reliable for me. Now with this fix I can do both? Just switched from the 5GHz to 2.4GHz network while typing. Very stable on my 14,3.

marc-git avatar Nov 10 '19 17:11 marc-git

@marc-git As I already mentioned in bugzilla that's not yet a complete solution. I did some tests and connecting to nearby 2.4Ghz access points (no matter if they use encryption or not) simply doesn't work for me with the latest changes applied. 5Ghz works fine so far though.

This is working fine for me. I had been doing sudo iwconfig wlp3s0 txpower 10 for a while and could only get 2.4GHz networks, but that was quite reliable for me. Now with this fix I can do both? Just switched from the 5GHz to 2.4GHz network while typing. Very stable on my 14,3.

Same. Can switch flawlessy between 2.4 and 5 GHz.

mkexc avatar Nov 10 '19 21:11 mkexc

dunno if this would help or make it easier for anyone but putting/overwriting those files in /lib/firmware/brcm/ works for my 14,3 mbp on ubuntu 19.10 kernel 5.3 (even on a customiso) brcmfmac43602-pcie.zip

big props to those guys from https://bugzilla.kernel.org/show_bug.cgi?id=193121#c52 as already mentioned several times

devalanche avatar Dec 07 '19 11:12 devalanche

According to the latest posts from the original discussion, just a few days a go someone managed to set the correct parameters for the driver in order to make WiFi 5GHz work with mbp 13.2 and 13.3:

  1. Download this file.
  2. Open it with a text editor and set the mac address line with your own card's address.
  3. Place it in /lib/firmware/brcm.

I tried it and it works with my 13.3 in a Manjaro live USB. Haven't installed it yet, so I can't provide a review for long-term use, though.

Trying right now on Ubuntu 19.10 installed on internal SSD. Will update with news soon.

EDIT: Can confirm that it works!!! 5GHz network connected and it's also fast(and stable)!(Not as good as on macOS tho, on macOS i got ā‰ƒ 900+Mbps, on Ubuntu i got ā‰ƒ 300+Mbps). Tested on 13.3, Ubuntu 19.10 stock kernel.

@Dunedan, you can further test this if needed and eventually add to the README.

I can confirm this worked as well for me with MBP 13.2 with Linux Mint 19.3 and kernel version 5.4.6.

System:    Host: asimov-MacBookPro Kernel: 5.4.6-050406-generic x86_64 bits: 64 compiler: gcc 
           v: 9.2.1 Desktop: Cinnamon 4.4.5 wm: muffin dm: LightDM Distro: Linux Mint 19.3 Tricia 
           base: Ubuntu 18.04 bionic 
Machine:   Type: Laptop System: Apple product: MacBookPro13,3 v: 1.0 serial: <filter> Chassis: 
           type: 9 v: Mac-A5C67F76ED83108C serial: <filter> 
           Mobo: Apple model: Mac-A5C67F76ED83108C v: MacBookPro13,3 serial: <filter> UEFI: Apple 
           v: 263.0.0.0.0 date: 10/30/2019 
Battery:   ID-1: BAT0 charge: 52.8 Wh condition: 55.1/76.7 Wh (72%) volts: 12.6/11.5 
           model: SMP bq20z451 serial: N/A status: Full 
           Device-1: hidpp_battery_0 model: Logitech Wireless Keyboard serial: <filter> 
           charge: 55% status: Discharging 
CPU:       Topology: Quad Core model: Intel Core i7-6920HQ bits: 64 type: MT MCP arch: Skylake-S 
           rev: 3 L2 cache: 8192 KiB 
           flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 46398 
           Speed: 900 MHz min/max: 800/3800 MHz Core speeds (MHz): 1: 897 2: 900 3: 900 4: 895 
           5: 900 6: 900 7: 900 8: 899 
Graphics:  Device-1: AMD Baffin [Radeon RX 460/560D / Pro 450/455/460/555/560] vendor: Apple 
           driver: amdgpu v: kernel bus ID: 01:00.0 chip ID: 1002:67ef 
           Display: x11 server: X.Org 1.20.4 driver: amdgpu,ati unloaded: fbdev,modesetting,vesa 
           resolution: 1920x1080~60Hz, 1920x1080~60Hz 
           OpenGL: renderer: AMD Radeon RX Graphics v: 4.6.13564 Core Profile Context 
           compat-v: 4.6.13564 direct render: Yes 
Audio:     Device-1: Intel 100 Series/C230 Series Family HD Audio driver: snd_hda_intel v: kernel 
           bus ID: 00:1f.3 chip ID: 8086:a170 
           Device-2: AMD driver: snd_hda_intel v: kernel bus ID: 01:00.1 chip ID: 1002:aae0 
           Sound Server: ALSA v: k5.4.6-050406-generic 
Network:   Device-1: Broadcom and subsidiaries BCM43602 802.11ac Wireless LAN SoC vendor: Apple 
           driver: brcmfmac v: kernel port: 3000 bus ID: 03:00.0 chip ID: 14e4:43ba 
           IF: wlp3s0 state: up mac: <filter> 
Drives:    Local Storage: total: 465.92 GiB used: 12.40 GiB (2.7%) 
           ID-1: /dev/nvme0n1 vendor: Apple model: SSD SM0512L size: 465.92 GiB speed: 31.6 Gb/s 
           lanes: 4 serial: <filter> 
Partition: ID-1: / size: 457.11 GiB used: 12.40 GiB (2.7%) fs: ext4 dev: /dev/nvme0n1p2 
Sensors:   System Temperatures: cpu: 59.0 C mobo: N/A 
           Fan Speeds (RPM): N/A 
Repos:     No active apt repos in: /etc/apt/sources.list 
           Active apt repos in: /etc/apt/sources.list.d/amdgpu-pro-local.list 
           1: deb [ trusted=yes ] file: /var/opt/amdgpu-pro-local/ ./
           Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list 
           1: deb http: //ftp.acc.umu.se/mirror/linuxmint.com/packages tricia main upstream import backport
           2: deb http: //archive.ubuntu.com/ubuntu bionic main restricted universe multiverse
           3: deb http: //archive.ubuntu.com/ubuntu bionic-updates main restricted universe multiverse
           4: deb http: //archive.ubuntu.com/ubuntu bionic-backports main restricted universe multiverse
           5: deb http: //security.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
           6: deb http: //archive.canonical.com/ubuntu/ bionic partner
Info:      Processes: 275 Uptime: 3m Memory: 15.54 GiB used: 1.57 GiB (10.1%) Init: systemd v: 237 
           runlevel: 5 Compilers: gcc: 7.4.0 alt: 7 Client: Unknown python3.6 client inxi: 3.0.32 

andyholst avatar Dec 28 '19 06:12 andyholst

According to the latest posts from the original discussion, just a few days a go someone managed to set the correct parameters for the driver in order to make WiFi 5GHz work with mbp 13.2 and 13.3:

1. Download [this](https://bugzilla.kernel.org/attachment.cgi?id=285753) file.

2. Open it with a text editor and set the mac address line with your own card's address.

3. Place it in /lib/firmware/brcm.

I tried it and it works with my 13.3 in a Manjaro live USB. Haven't installed it yet, so I can't provide a review for long-term use, though.

I can confirm working on 13,2 Ubuntu 19.10.

For me 2.4 GHz worked even without this file if I used it with open networks (even Xfinity in the US).

tawheedmanzoor avatar Feb 09 '20 03:02 tawheedmanzoor

  1. Download this file.
  2. Open it with a text editor and set the mac address line with your own card's address.
  3. Place it in /lib/firmware/brcm.

I have a MacBookPro12,1 with BCM43602 [14e4:43ba] (rev 01). Should I expect this to enable 5 GHz for me? (it doesn't)

svenper avatar Apr 09 '20 19:04 svenper

Hi, I have a MacBook Pro mid 2016 with touchbar, internet works fine after applying this fix: https://bugzilla.kernel.org/show_bug.cgi?id=193121#c62 The only problem I currently have is that (at least with Ubuntu 20.04 and Manjaro 19), wifi won't reconnect to previous connected networks after sleep (suspend). Have anyone experienced the same issue? @MrAsimov

cristianmiranda avatar Apr 29 '20 03:04 cristianmiranda

@Dunedan you should update the README.md section for WIFI both 2.4/5 GHz wifi is working for me on MacBookPro13,3.

andyholst avatar Jun 08 '20 21:06 andyholst

Feel free to open a PR with the necessary updates to the README. I never got Wifi to work reliably on both 2.4Ghz and 5Ghz bands, but as I don't own a recent MacBook Pro anymore, I can't try out things possible solutions anymore.

Dunedan avatar Jun 09 '20 16:06 Dunedan

Feel free to open a PR with the necessary updates to the README. I never got Wifi to work reliably on both 2.4Ghz and 5Ghz bands, but as I don't own a recent MacBook Pro anymore, I can't try out things possible solutions anymore.

What is your machine? 14,3? Anybody have a 14,3 for which the bugzilla workaround isn't a fix? Or can people mention if they have a BCM43602 that isn't working with this workaround and what their setup is.

marc-git avatar Jul 23 '20 14:07 marc-git

@christophgysin I believe I lost wifi connection after a suspension session. Never tried it thoroughly. I am ready to open up a PR if the wifi driver patch for MBP models 13,2; 13,3; 14,2 and 14,3 is working for both 2.4/5 Ghz for the BCM43602 802.11ac Wireless LAN SoC (rev 02) device.

For me the 5Ghz wifi works pretty well.

andyholst avatar Jul 23 '20 20:07 andyholst

For 2 Ghz band to work I have to set the tx power to 10 dBm iwconfig wlp3s0 txpower 10dBm with default brcmfmac43602-pcie.bin firmware. For it to work with 5 Ghz band, I have to use the brcmfmac43602-pcie.txt file and override the firmware binary configuration https://bugzilla.kernel.org/show_bug.cgi?id=193121#c52 with proper mac address set for it to work.

andyholst avatar Jul 23 '20 22:07 andyholst

Yes would be great to hear from more people first. At the moment we could say that some people with these machines have working wifi using those workarounds. Would be great to hear from somebody for whom it isn't working and what their config is.

marc-git avatar Jul 24 '20 07:07 marc-git

What is most interesting for me is that if you set the region code (ccode) to the global value 00 (with bvi editor) in the binary /lib/firmware/brcm/brcmfmac43602-pcie.bin file without the txt file included, then 2 Ghz band work (might still have to reduce the tx power to increase stability).

So if you copy the 2 Ghz band property values (not so many really) from the binary to the brcmfmac43602-pcie.txt it should be possible to get working 2.4/5 Ghz band connections. The trick is to properly convert the decimal values to 2 signed complement hex and vice versa by comparing with the 5G property values set in brcmfmac43602-pcie.txt where it occurs (they are literally named the same)

Best is if you could do the configuration after the reference manual or if the newer firmware bin file works out of the box.

andyholst avatar Jul 24 '20 12:07 andyholst

Ok, so I have been fiddling with 2 configuration brcmfmac43602-pcie files; one from the https://bugzilla.kernel.org/show_bug.cgi?id=193121#c52 and one from the https://bugzilla.kernel.org/show_bug.cgi?id=193121#c64 generated through captured NVRAM VFIO trace from a Windows broadcom 43602 firmware.

I only kept the swctrlmap_5g and swctrlmapext_5g key values from the first file and added those to the generated NVRAM VFIO trace brcmfmac43602-pcie file and removed some keys and values from that one to get 5 Ghz band working with double download speed from 20/40 Mbit/s up to 70/80 Mbit/s.

brcmfmac43602-pcie.txt

Next is to figure out to get a stable 2 Ghz band connection. I did a new post over at https://bugzilla.kernel.org/show_bug.cgi?id=193121

andyholst avatar Jul 24 '20 21:07 andyholst

I did a few more modifications to the brcmfmac43602-pcie.txt configuration file to be more similar to the original NVRAM VFIO trace file for the brcmfmac 43602 windows based firmware generated by Sonal Santan https://github.com/sonals/macbookpro14-3/blob/master/doc/MMIOTrace.rst

brcmfmac43602-pcie.txt

andyholst avatar Jul 25 '20 02:07 andyholst

It might help to interpreter the board flags for the broadcom device at https://android.googlesource.com/kernel/common.git/+/bcmdhd-3.10/drivers/net/wireless/bcmdhd/include/bcmdevs.h while testing the brcmfmac43602-pcie.txt configuration.

andyholst avatar Jul 25 '20 17:07 andyholst

Ok, I am going at the right direction, I did compare the brcmfmac43602-pcie.txt configuration file generated by the NVRAM VFIO trace and compared the hex values for the boardflags2 and boardflags3 keys with the original brcmfmac43602-pcie.bin file when none configuration is set. I can confirm that the boardflags3 is the one 'deciding' if 2.4Ghz band and 5Ghz band is going to be used.

The original boardflags2 and boardflags3 hex values from the original brcmfmac43602-pcie.bin without configuration is:

boardflags2=0x00000002 boardflags3=0x00000003

With this configuration along with the NVRAM VFIO trace file data, the 2 Ghz band connection works just fine during boot or through the sudo rmmod brcmfmac && sudo modprobe brcmfmac command. By setting the boardflags3 to 0x00000300 the 5 Ghz band works very well with 60/80 Mbits internet download speed connection.

The last piece of the puzzle if possible is to figure out what combination needs to be set for boardflags3 to enable 2.4/5 Ghz band at the same time, 0x00000303 did not do it, it only enabled 5Ghz band, anyone want to try to brute force the combination? :)

So either use boardflags3 hex value 0x00000300 for 5 Ghz band (0x00000303) or 0x00000003 for 2 Ghz band and use the proper sudo rmmod brcmfmac && sudo modprobe brcmfmac command after the change to the brcmfmac43602-pcie.txt for it to take effect.

The BCM43602 firmware (brcmfmac43602-pcie.bin) is programmed with default mac address (develop mode, should be generated) and can be randomized with the command sudo macchanger -r wlp3s0, be sure to restart the device with sudo ifconfig wlp3s0 down and sudo ifconfig wlp3s0 up after the mac address change or let the macchanger deal with it automatically (can be set during setup) when device is starting during boot.

brcmfmac43602-pcie.txt

andyholst avatar Jul 26 '20 02:07 andyholst

OK I also realised that my 2.4GHz was not working simultaneously with 5GHz now.
@andyholst did you get any further?

marc-git avatar Aug 06 '20 10:08 marc-git

@marc-git can you confirm that brcmfmac43602-pcie.txt I added did it for you? Or did you test another configuration? I have not tested the combinations for a while, but the last 2 weeks I can confirm that the 2 Ghz band works just fine if you are within 20 meters with no so much interference such as many routers or thick walls (if you have strong router signal), I usually use the 5 Ghz band though.

andyholst avatar Aug 07 '20 18:08 andyholst

I have created bash script to brute force the boardflags3 configuration to see if there is a combination to allow connecting to 2.4 Ghz or 5 Ghz band without changing the boardflags3 configurations https://github.com/andyholst/BCM43602_macbookpro

Feel free to fork it and add optimizations, I will try to brute force the configurations next week.

andyholst avatar Aug 09 '20 18:08 andyholst

@marc-git can you confirm that brcmfmac43602-pcie.txt I added did it for you? Or did you test another configuration? I have not tested the combinations for a while, but the last 2 weeks I can confirm that the 2 Ghz band works just fine if you are within 20 meters with no so much interference such as many routers or thick walls (if you have strong router signal), I usually use the 5 Ghz band though.

Your file works fine but I can't tell what frequency I am on. Will have to wait until I get a 2.4GHz network only.

marc-git avatar Aug 11 '20 10:08 marc-git

Hello again. @andyholst what boardflags3 setting are you using nowadays?

marc-git avatar Aug 11 '21 08:08 marc-git

@marc-git same settings, mainly using 5Ghz, though 2.4 GHz and 5GHz incorporated to the same SSID.

andyholst avatar Sep 06 '21 21:09 andyholst

@andyholst so this one ? boardflags3=0x00000003

marc-git avatar Oct 17 '21 11:10 marc-git

@marc-git for 2Ghz, boardflags3=0x00000003 and for 5 Ghz, boardflags3=0x00000303

`sromrev=11 subvid=0x14e4 boardtype=0x61b boardrev=0x1421 vendid=0x14e4 devid=0x43ba

macaddr=00:90:4c:0d:f4:3e

ccode=00 regrev=245

boardflags=0x10401001 boardflags2=0x00000002 boardflags3=0x00000303 boardnum=62526

swctrlmap_2g=0x04010401,0x08080808,0x04010401,0x00000000,0x000000ff swctrlmapext_2g=0x00000000,0x00000000,0x00000000,0x000000,0x003

swctrlmap_5g=0x08080808,0x04010401,0x08080808,0x00000000,0x000000ff swctrlmapext_5g=0x00000000,0x00000000,0x00000000,0x000000,0x003

aa2g=7 aa5g=7 agbg0=133 agbg1=133 agbg2=133 aga0=71 aga1=71 aga2=71 txchain=7 rxchain=7 antswitch=0 tssiposslope2g=1 epagain2g=0 pdgain2g=28 tworangetssi2g=0 papdcap2g=0 femctrl=2 tssiposslope5g=1 epagain5g=0 pdgain5g=28 tworangetssi5g=0 papdcap5g=0 gainctrlsph=0 tempthresh=120 tempoffset=255 rawtempsense=0x1ff measpower=0x7f tempsense_slope=0xff tempcorrx=0x3f tempsense_option=0x3 xtalfreq=40000 phycal_tempdelta=40 temps_period=1 temps_hysteresis=5 measpower1=0x7f measpower2=0x7f pdoffsetcck=1057 pdoffset20in40m5gb0=0 pdoffset20in40m5gb1=0 pdoffset20in40m5gb2=0 pdoffset20in40m5gb3=0 pdoffset20in40m5gb4=0 pdoffset40in80m5gb0=0 pdoffset40in80m5gb1=0 pdoffset40in80m5gb2=0 pdoffset40in80m5gb3=0 pdoffset40in80m5gb4=0 pdoffset20in80m5gb0=0 pdoffset20in80m5gb1=0 pdoffset20in80m5gb2=0 pdoffset20in80m5gb3=0 pdoffset20in80m5gb4=0 subband5gver=0x5 cckbw202gpo=0 cckbw20ul2gpo=0 mcsbw202gpo=2536714240 mcsbw402gpo=2536714240 dot11agofdmhrbw202gpo=13056 ofdmlrbw202gpo=0 mcsbw205glpo=1966288896 mcsbw405glpo=2252619776 mcsbw805glpo=2252619776 mcsbw205gmpo=1966288896 mcsbw405gmpo=2252619776 mcsbw805gmpo=2252619776 mcsbw205ghpo=1966288896 mcsbw405ghpo=2252619776 mcsbw805ghpo=2252619776 mcsbw205gx1po=1966288896 mcsbw405gx1po=2252619776 mcsbw805gx1po=2252619776 mcsbw205gx2po=1966288896 mcsbw405gx2po=2252619776 mcsbw805gx2po=2252619776 mcslr5glpo=0 mcslr5gmpo=0 mcslr5ghpo=0 mcslr5gx1po=0 mcslr5gx2po=0 sb20in40hrpo=0 sb20in80and160hr5glpo=0 sb40and80hr5glpo=0 sb20in80and160hr5gmpo=0 sb40and80hr5gmpo=0 sb20in80and160hr5ghpo=0 sb40and80hr5ghpo=0 sb20in40lrpo=0 sb20in80and160lr5glpo=0 sb40and80lr5glpo=0 sb20in80and160lr5gmpo=0 sb40and80lr5gmpo=0 sb20in80and160lr5ghpo=0 sb40and80lr5ghpo=0 sb20in80and160hr5gx1po=0 sb20in80and160lr5gx1po=0 sb40and80hr5gx1po=0 sb20in80and160hr5gx2po=0 sb20in80and160lr5gx2po=0 sb40and80hr5gx2po=0 dot11agduphrpo=0 dot11agduplrpo=52416 pcieingress_war=15 sar2g=18 sar5g=15 noiselvl2ga0=31 noiselvl2ga1=31 noiselvl2ga2=31 noiselvl5ga0=18,18,18,20 noiselvl5ga1=1,1,1,17 noiselvl5ga2=11,11,11,11 rxgainerr2ga0=63 rxgainerr2ga1=31 rxgainerr2ga2=31 rxgainerr5ga0=50,50,50,52 rxgainerr5ga1=16,16,16,24 rxgainerr5ga2=5,5,5,5 rpcal2g=65535 rpcal5gb0=65535 rpcal5gb1=65535 rpcal5gb2=65535 rpcal5gb3=65535 rxgains5gmelnagaina0=3 rxgains5gmelnagaina1=3 rxgains5gmelnagaina2=3 rxgains5gmtrisoa0=9 rxgains5gmtrisoa1=9 rxgains5gmtrisoa2=9 rxgains5gmtrelnabypa0=0 rxgains5gmtrelnabypa1=0 rxgains5gmtrelnabypa2=0 rxgains5ghelnagaina0=2 rxgains5ghelnagaina1=2 rxgains5ghelnagaina2=2 rxgains5ghtrisoa0=8 rxgains5ghtrisoa1=8 rxgains5ghtrisoa2=8 rxgains5ghtrelnabypa0=0 rxgains5ghtrelnabypa1=0 rxgains5ghtrelnabypa2=0 gain_cal_temp=39 rssi_delta_2gb0=8,16,8,16,253,18,253,18,254,17,254,17 rssi_delta_2gb1=255,255,255,255,255,255,255,255,255,255,255,255 rssi_delta_2gb2=255,255,255,255,255,255,255,255,255,255,255,255 rssi_delta_2gb3=255,255,255,255,255,255,255,255,255,255,255,255 rssi_delta_2gb4=255,255,255,255,255,255,255,255,255,255,255,255 rssi_cal_freq_grp_2g=0,0,128,0,0,0,0 rud_agc_enable=0 temp_comp_tr_loss=1 rssi_qdB_en=0 rssi_delta_5gl=8,6,8,6,8,6,5,6,5,6,5,6,9,8,9,8,9,8 rssi_delta_5gml=250,237,250,237,250,237,248,236,248,236,248,236,249,237,249,237,249,237 rssi_delta_5gmu=250,237,250,237,250,237,248,234,248,234,248,234,249,237,249,237,249,237 rssi_delta_5gh=250,235,250,235,250,235,247,233,247,233,247,233,249,237,249,237,249,237 rssicorrnorm_c0=251,255 rssicorrnorm_c1=251,255 rssicorrnorm_c2=251,255 trloss_adj_temp_thresh=10 trloss_adj_time_dur=30 rstr_rxgaintempcoeff5gl=50,50,50 rstr_rxgaintempcoeff5gl_elnaoff=44,44,44 rstr_rxgaintempcoeff5gml=50,50,50 rstr_rxgaintempcoeff5gml_elnaoff=44,44,44 rstr_rxgaintempcoeff5gmu=50,50,50 rstr_rxgaintempcoeff5gmu_elnaoff=44,44,44 rstr_rxgaintempcoeff5gh=52,52,52 rstr_rxgaintempcoeff5gh_elnaoff=46,46,46 rstr_rxgaintempcoeff2g_sub=75,75,75,75,75,75,75,75,75,75,75,75,75,75,75 rstr_rxgaintempcoeff2g_sub_elnaoff=66,66,66,66,66,66,66,66,66,66,66,66,66,66,66 length_txcal=65535 version_txcal=65535 devicetype_txcal=65535 caltype_txcal=65535 tempsense_txcal=35 ncores_txcal=255 reserved1_txcal=255 reserved2_txcal=255 20mhz_tbl_len_txcal=65535 nsteps_txcal=22 nchannels_txcal=10 chan_id_txcal_ch0=7 chan_id_txcal_ch1=36 chan_id_txcal_ch2=52 chan_id_txcal_ch3=64 chan_id_txcal_ch4=100 chan_id_txcal_ch5=120 chan_id_txcal_ch6=140 chan_id_txcal_ch7=149 chan_id_txcal_ch8=157 chan_id_txcal_ch9=165 ptssi_txcal_ch0=0 ptssi_txcal_ch1=0 ptssi_txcal_ch2=0 ptssi_txcal_ch3=0 ptssi_txcal_ch4=0 ptssi_txcal_ch5=0 ptssi_txcal_ch6=0 ptssi_txcal_ch7=0 ptssi_txcal_ch8=0 ptssi_txcal_ch9=0 gain_index_c0_ch0=54 gain_index_c0_ch1=57 gain_index_c0_ch2=58 gain_index_c0_ch3=59 gain_index_c0_ch4=60 gain_index_c0_ch5=59 gain_index_c0_ch6=61 gain_index_c0_ch7=60 gain_index_c0_ch8=61 gain_index_c0_ch9=62 gain_index_c1_ch0=54 gain_index_c1_ch1=58 gain_index_c1_ch2=59 gain_index_c1_ch3=60 gain_index_c1_ch4=61 gain_index_c1_ch5=61 gain_index_c1_ch6=62 gain_index_c1_ch7=62 gain_index_c1_ch8=62 gain_index_c1_ch9=62 gain_index_c2_ch0=57 gain_index_c2_ch1=57 gain_index_c2_ch2=59 gain_index_c2_ch3=59 gain_index_c2_ch4=61 gain_index_c2_ch5=60 gain_index_c2_ch6=61 gain_index_c2_ch7=61 gain_index_c2_ch8=61 gain_index_c2_ch9=61 tssi_chan0_c0=248,244,241,237,232,226,220,211,203,193,183,172,162,150,138,128,116,105,94,83,73,61 tssi_chan0_c1=247,245,241,237,232,226,218,210,201,191,181,168,158,146,134,122,111,98,87,75,64,52 tssi_chan0_c2=248,245,242,238,233,227,221,213,204,194,185,173,162,151,140,129,118,107,97,87,77,67 tssi_chan1_c0=234,228,223,218,212,205,198,191,183,176,168,159,150,141,131,121,110,98,87,75,64,53`

andyholst avatar Nov 03 '21 02:11 andyholst

@andyholst This is a pretty long thread and I’m trying to find exactly what changes I need to make, between all the comments in this thread and the bugzilla thread. Do you have a tldr; ? I could contribute it to the readme once I figure it out

atyshka avatar Apr 13 '22 23:04 atyshka