Skip to contentSkip to conversation

b43 register dumping/setting

DISCUSSION Matthew Garrett 2 participants 6 messages Mar 6, 2014

lore
Share & tools
lore
#0 lore raw

Every time I send a packet on the 4331 in this Macbook Pro, the screen flickers. It doesn't happen with the closed driver. Is there a simple way to dump the SSB and b43 registers from userspace and rewrite them in an attempt to identify whether there's some magic "Don't fuck with my displayport timings" bit?

Signature · 1 line
Matthew Garrett | mjg59 at srcf.ucam.org
#1 lore raw

2014-03-06 2:40 GMT+01:00 Matthew Garrett <[email protected]>:

Quoted 5 lines

Every time I send a packet on the 4331 in this Macbook Pro, the screen flickers. It doesn't happen with the closed driver. Is there a simple way to dump the SSB and b43 registers from userspace and rewrite them in an attempt to identify whether there's some magic "Don't fuck with my displayport timings" bit?

Oh, that's something new.
There isn't such tool according to my knowledge and it may be a tricky to track everything needed.

First, please note BCM4331 is using BCMA instead of the older SSB. Second, there are plenty of registers you may need to dump. BCMA bus has multiple cores, every core has it's agent/wrapper core. You should probably dump registers of PCIe, ChipCommon and 80211 cores. To make that more tricky PCIe and 80211 cores have few sets of indirect registers.

As a quick test: did you try pio mode? I'm not even sure if it used to work with BCM4331, but it's easy to try. Just b43.pio=1.

Signature · 1 line
Rafa?
#2 lore raw
Quoted 6 lines · Rafa? Mi?ecki

First, please note BCM4331 is using BCMA instead of the older SSB. Second, there are plenty of registers you may need to dump. BCMA bus has multiple cores, every core has it's agent/wrapper core. You should probably dump registers of PCIe, ChipCommon and 80211 cores. To make that more tricky PCIe and 80211 cores have few sets of indirect registers.

Awesomes. I'll see what I can figure out.

Quoted 2 lines

As a quick test: did you try pio mode? I'm not even sure if it used to work with BCM4331, but it's easy to try. Just b43.pio=1.

On the plus side, no corruption. On the down side, no packets. I don't get any scan results and never associate, so probably not an entirely fair comparison.

Signature · 1 line
Matthew Garrett | mjg59 at srcf.ucam.org
#3 lore raw

2014-03-06 7:42 GMT+01:00 Matthew Garrett <[email protected]>:

Quoted 10 lines · Rafa? Mi?ecki
Quoted 7 lines

First, please note BCM4331 is using BCMA instead of the older SSB. Second, there are plenty of registers you may need to dump. BCMA bus has multiple cores, every core has it's agent/wrapper core. You should probably dump registers of PCIe, ChipCommon and 80211 cores. To make that more tricky PCIe and 80211 cores have few sets of indirect registers.

Awesomes. I'll see what I can figure out.

With bcma & b43 it should be doable, but what about dumping registers from closed source driver? Did you figure out some way?

I think Broadcom exports interface to access registers (not sure which ones). It's used by (closed source AFAIK) user space tool "wl"
(http://www.dd-wrt.com/wiki/index.php/WL and search for "reg"). However "wl" binary is available for MIPS and ARM only. At least I've never seen it compiled for x86.
You may try to get "wlc" tool from OpenWrt (which is basically open source tool for talking with wl.ko) and extend it to support ioctls for REGs access.

#4 lore raw
Quoted 2 lines · Rafa? Mi?ecki

With bcma & b43 it should be doable, but what about dumping registers from closed source driver? Did you figure out some way?

My rough plan was to just mmap the BARs and do it from userspace...

Interestingly, I can't reproduce the problem at the moment. On the other hand, I'm also far closer to the AP, so broadcast power may have been lower? I'm not actually entirely sure what could lead to sufficient interference to screw with the DisplayPort link (it seems like it happens with both GPUs on the machine, so it seems more likely that it's interfering with the signal than somehow screwing with a clock) so don't have many good ideas to start with.

Signature · 1 line
Matthew Garrett | mjg59 at srcf.ucam.org
#5 lore raw

2014-03-06 8:14 GMT+01:00 Matthew Garrett <[email protected]>:

Quoted 7 lines · Rafa? Mi?ecki
Quoted 3 lines

With bcma & b43 it should be doable, but what about dumping registers from closed source driver? Did you figure out some way?

My rough plan was to just mmap the BARs and do it from userspace...

Quoted 7 lines

Interestingly, I can't reproduce the problem at the moment. On the other hand, I'm also far closer to the AP, so broadcast power may have been lower? I'm not actually entirely sure what could lead to sufficient interference to screw with the DisplayPort link (it seems like it happens with both GPUs on the machine, so it seems more likely that it's interfering with the signal than somehow screwing with a clock) so don't have many good ideas to start with.

We had some reports about interrupts problems when using Broadcom WiFi and ATI GPUs. There were some straight messages in dmesg about interrupts. I'm not sure if interrupts can also affect DisplayPort in some way :|

Signature · 1 line
Rafa?