1: 3716978f7267 ! 1: 764f376b8d68 wifi: brcmfmac: leave the AP 4-way handshake to the host on Apple chips @@ Commit message  The Apple firmware for the BCM4364 and BCM4377 lists "idauth" in its capabilities, so brcmfmac enables BRCMF_FEAT_FWAUTH and advertises - NL80211_EXT_FEATURE_4WAY_HANDSHAKE_AP_PSK. hostapd and wpa_supplicant - then pass the PSK to the driver and leave the AP side of the 4-way - handshake to the firmware. On the BCM4364 that handshake never - completes. The client associates, no EAPOL-Key frame is sent, and the - firmware removes the station after about 8 s. + NL80211_EXT_FEATURE_4WAY_HANDSHAKE_AP_PSK and, with "sae", + NL80211_EXT_FEATURE_SAE_OFFLOAD_AP. hostapd and wpa_supplicant then leave + the AP side of the handshake to the firmware, which doesn't complete.  - Measured on a MacBookPro15,1 (BCM4364/3, firmware 9.30.514.0.32.5.94, - FWID 01-47278712) with a WPA2-PSK access point and a Samsung Galaxy - S22 Ultra as client: + With a WPA2-PSK AP, brcmfmac sets the PMK in the firmware without error, + the client associates, the firmware sends no EAPOL-Key frame and removes + the station after about 8 s. Seen on the BCM4364 (MacBookPro15,1) and on + the BCM4377 (MacBookAir9,1). With a WPA3-SAE AP and PMF required on the + BCM4377, the client associates and is removed the same way without being + authorized.  - offload advertised: NEW_STATION, DEL_STATION 7.8 s later, no EAPOL - offload not advertised: 4-way handshake by wpa_supplicant completes, - AP-STA-CONNECTED, DHCP lease, traffic flows - - Clear BRCMF_FEAT_FWAUTH on the chips in Apple's T2 Macs, so the host - runs the handshake. + Clear BRCMF_FEAT_FWAUTH on these chips when the board type is Apple, so + the host runs the handshake. A WPA2-PSK AP then works. This also drops + SAE_OFFLOAD_AP, which is not usable on this firmware. A WPA3-SAE AP does + not work without the offload either, the client does not associate.  Tested-by: Yossef Osman  Tested-by: Aditya Garg  @@ drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c: void brcmf_feat_atta } }  + /* The Apple firmware for these chips lists "idauth", but in AP mode -+ * its authenticator never completes the 4-way handshake and the -+ * station is dropped after about 8 s. Leave the handshake to the host. ++ * it never completes the 4-way handshake or SAE, and the station is ++ * dropped. Leave the handshake to the host.  + */ -+ switch (drvr->bus_if->chip) { -+ case BRCM_CC_4355_CHIP_ID: -+ case BRCM_CC_4364_CHIP_ID: -+ case BRCM_CC_4377_CHIP_ID: -+ ifp->drvr->feat_flags &= ~BIT(BRCMF_FEAT_FWAUTH); -+ break; -+ default: -+ break; ++ if (drvr->settings->board_type && ++ strstarts(drvr->settings->board_type, "apple,")) { ++ switch (drvr->bus_if->chip) { ++ case BRCM_CC_4364_CHIP_ID: ++ case BRCM_CC_4377_CHIP_ID: ++ ifp->drvr->feat_flags &= ~BIT(BRCMF_FEAT_FWAUTH); ++ break; ++ default: ++ break; ++ }  + } -+ /* MBSS does not work for all chips */ switch (drvr->bus_if->chip) { case BRCM_CC_4330_CHIP_ID: