• Ping-Ke Shih's avatar
    rtw88: fix EAPOL 4-way failure by finish IQK earlier · 7a242fb6
    Ping-Ke Shih authored
    Connecting to an AP with WPA2 security may fail. The IQK
    and the EAPOL 4-way handshake may overlap because the
    driver does IQK right after assoc success.
    
    For 802.11n devices, the IQK is done in the driver and it
    could require more than 100ms to complete. During IQK, any
    TX/RX events are paused. So if the EAPOL 4-way handshake
    started before IQK finished, then the 1/4 and 2/4 part of
    the handshake could be dropped. The AP will then issue
    deauth with reason IEEE8021X_FAILED (23).
    
    To resolve this, move IQK routine into managed TX prepare
    (ieee80211_ops::mgd_prepare_tx()). The callback is called
    before the managed frames (auth/assoc) are sent. This will
    make sure that the IQK is completed before the handshake
    starts. But don't do IQK during scanning because doing it
    on each channel will take too long.
    
    For 802.11ac devices, the IQK is done in firmware and it
    takes less time to complete. Therefore we don't see a
    failure during the EAPOL 4-way handshake. But it is still
    worth moving the IQK into ieee80211_ops::mgd_prepare_tx().
    
    Fixes: f5df1a8b ("rtw88: 8723d: Add 8723DE to Kconfig and Makefile")
    Tested-by: default avatarYou-Sheng Yang <vicamo.yang@canonical.com>
    Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
    Signed-off-by: default avatarYan-Hsuan Chuang <yhchuang@realtek.com>
    Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20200529025009.2468-4-yhchuang@realtek.com
    7a242fb6
main.c 41.2 KB