2021-03-04 19:33:22

by James Prestwood

[permalink] [raw]
Subject: SAE offload on brcmfmac (BCM4345)

Hi,

I am trying to get SAE offload support on a BCM4345 (raspberry pi B+).
From what I can tell it appears the Cypress firmware is not enabling
the right bits. It looks like the brcmfmac driver has all the code to
enable the extended feature. Here is what I have done so far:

Cloned raspi linux kernel v5.4

Downloaded latest Cypress firmware:
https://community.cypress.com/t5/Resource-Library/Cypress-Linux-WiFi-Driver-Release-FMAC-2020-09-25/ta-p/251089

Applied the patches from above. Note not *all* the patches applied
(could be due to already upstreamed), but most did. I did have to fix
an include issue so brcmfmac/cfg80211.c could reference
LINUX_CODE_VERSION/LINUX_VERSION.

Built new kernel/installed etc.

After that everything built, and I do see SAE offload source code which
sets the ext feature if BRCMF_FEAT_SAE is enabled.

I see my new kernel here:

Linux raspberrypi 5.4.83-v7+ #2 SMP Thu Mar 4 10:54:16 PST 2021 armv7l
GNU/Linux

and dmesg shows the new firmware loading:

[ 7.315275] brcmfmac: F1 signature read @0x18000000=0x15264345
[ 7.337608] brcmfmac: brcmf_fw_alloc_request: using
brcm/brcmfmac43455-sdio for chip BCM4345/6
[ 7.338104] usbcore: registered new interface driver brcmfmac
[ 7.606184] brcmfmac: brcmf_fw_alloc_request: using
brcm/brcmfmac43455-sdio for chip BCM4345/6
[ 7.616186] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6
wl0: Mar 23 2020 02:19:54 version 7.45.206 (r725000 CY) FWID 01-
88ee44ea

Yet iw does not have SAE_OFFLOAD set as an extended feature:

Supported extended features:
* [ 4WAY_HANDSHAKE_STA_PSK ]: 4-way handshake with PSK in
station mode
* [ 4WAY_HANDSHAKE_STA_1X ]: 4-way handshake with 802.1X in
station mode
* [ DFS_OFFLOAD ]: DFS offload

Thanks,
James


2021-03-15 17:50:09

by James Prestwood

[permalink] [raw]
Subject: Re: SAE offload on brcmfmac (BCM4345)

Maybe a simpler question: What brcmfmac cards *do* support SAE offload?
So far I have tried:

BCM4345 (raspberry pi 3 B+)
BCM43602
BCM43242

The last two are quite old (fw dated 2013/2015) so I wouldn't expect
those to work. According to the documentation the BCM4345 should
support SAE offload, but me and several others have tried checking the
extended features and it is not enabled.

Thanks,
James

On Thu, 2021-03-04 at 11:29 -0800, James Prestwood wrote:
> Hi,
>
> I am trying to get SAE offload support on a BCM4345 (raspberry pi
> B+).
> From what I can tell it appears the Cypress firmware is not enabling
> the right bits. It looks like the brcmfmac driver has all the code to
> enable the extended feature. Here is what I have done so far:
>
> Cloned raspi linux kernel v5.4
>
> Downloaded latest Cypress firmware:
> https://community.cypress.com/t5/Resource-Library/Cypress-Linux-WiFi-Driver-Release-FMAC-2020-09-25/ta-p/251089
>
> Applied the patches from above. Note not *all* the patches applied
> (could be due to already upstreamed), but most did. I did have to fix
> an include issue so brcmfmac/cfg80211.c could reference
> LINUX_CODE_VERSION/LINUX_VERSION.
>
> Built new kernel/installed etc.
>
> After that everything built, and I do see SAE offload source code
> which
> sets the ext feature if BRCMF_FEAT_SAE is enabled.
>
> I see my new kernel here:
>
> Linux raspberrypi 5.4.83-v7+ #2 SMP Thu Mar 4 10:54:16 PST 2021
> armv7l
> GNU/Linux
>
> and dmesg shows the new firmware loading:
>
> [ 7.315275] brcmfmac: F1 signature read @0x18000000=0x15264345
> [ 7.337608] brcmfmac: brcmf_fw_alloc_request: using
> brcm/brcmfmac43455-sdio for chip BCM4345/6
> [ 7.338104] usbcore: registered new interface driver brcmfmac
> [ 7.606184] brcmfmac: brcmf_fw_alloc_request: using
> brcm/brcmfmac43455-sdio for chip BCM4345/6
> [ 7.616186] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6
> wl0: Mar 23 2020 02:19:54 version 7.45.206 (r725000 CY) FWID 01-
> 88ee44ea
>
> Yet iw does not have SAE_OFFLOAD set as an extended feature:
>
> Supported extended features:
> * [ 4WAY_HANDSHAKE_STA_PSK ]: 4-way handshake with PSK in
> station mode
> * [ 4WAY_HANDSHAKE_STA_1X ]: 4-way handshake with 802.1X in
> station mode
> * [ DFS_OFFLOAD ]: DFS offload
>
> Thanks,
> James
>

2021-03-15 21:18:54

by Alvin Šipraga

[permalink] [raw]
Subject: Re: SAE offload on brcmfmac (BCM4345)

Hi James,

On 3/15/21 6:46 PM, James Prestwood wrote:
> Maybe a simpler question: What brcmfmac cards *do* support SAE offload?

First of all, SAE offload support is technically a function of both
firmware AND chip, but the chip only matters in this equation because
some chips don't have enough memory to support the SAE offload
functionality of the firmware. If a firmware build string (strings
fwname.bin | grep Version) contains sae, idsup, and idauth, then it
really should advertise that capability back to the driver. The vendor
will not build a firmware with the sae capability if the target chipset
doesn't have enough memory to support it.

> So far I have tried:
>
> BCM4345 (raspberry pi 3 B+)

Quick note: according to the datasheet[1, p.18], the RPi 3B+ has a
CYW43455 (note the extra 5). Easily confused with the BCM4345, but
actually a completely different chip.

Please double check that you are using the correct firmware, because I
can see that the version string you quoted in your original email:

>> [ 7.616186] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Mar 23 2020 02:19:54 version 7.45.206 (r725000 CY) FWID 01-88ee44ea

seems not to agree with the version string in the latest Cypress FMAC
release you linked in the same email:

.../5.4.18-2020_0925/firmware $ strings cyfmac43455-sdio.bin | grep Version
43455c0-roml/43455_sdio-pno-aoe-pktfilter-pktctx-wfds-mfp-dfsradar-wowlpf-idsup-idauth-noclminc-clm_min-obss-obssdump-swdiv-gtkoe-roamprof-txbf-ve-sae-dpp-sr-okc-bpd
Version: 7.45.221 (3a6d3a0 CY) CRC: 8f977704 Date: Fri 2020-09-18
02:30:48 PDT Ucode Ver: 1043.2156 FWID 01-bbd9282b

Also make sure that the target firmware is appropriately named:

- the mainline driver expects the firmware to be at
/lib/firmware/brcm/brcmfmac43455-sdio.bin
- the Cypress backports driver expects the firmware to be at
/lib/firmware/cypress/cyfmac43455-sdio.bin

If you use the latest firmware release then it should advertise SAE
support. But I don't have the appropriate hardware to check for myself,
so the emphasis is on 'should'.

[1]
https://www.raspberrypi.org/documentation/hardware/computemodule/datasheets/rpi_DATA_CM3plus_1p0.pdf

> BCM43602
> BCM43242
>
> The last two are quite old (fw dated 2013/2015) so I wouldn't expect
> those to work. According to the documentation the BCM4345 should
> support SAE offload, but me and several others have tried checking the
> extended features and it is not enabled.

Right, those chips are far too old to support SAE offload due to memory
limitations.

Other Cypress chipsets which should support SAE offload:

CYW43455 (mentioned above)
CYW4373
CYW43012
CYW54591
CYW4343W
CYW4354 (parent of CYW43455)
CYW4356

Firmwares from the aforementioned Cypress FMAC release which should
support SAE offload:

cyfmac43012-sdio.bin
cyfmac43430-sdio.bin
cyfmac43455-sdio.bin
cyfmac4373-sdio.bin
cyfmac4373-usb.bin
cyfmac54591-pcie.bin

Kind regards,
Alvin