ath10k: fix WEP Shared authentication
authorMichal Kazior <michal.kazior@tieto.com>
Thu, 5 Dec 2013 05:53:41 +0000 (06:53 +0100)
committerKalle Valo <kvalo@qca.qualcomm.com>
Wed, 11 Dec 2013 05:50:40 +0000 (07:50 +0200)
Frames received from FW were treated incorrectly.
This led to stations being unable to associate to
WEP Shared ath10k AP. This was indicated by a
bizarre hostapd message:

  Unsupported authentication algorithm (36088)

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/wmi.c

index 1260a8d15dc3a5672f1eda93652fc7aa5133d121..9ea333a7789c8104cd90bc55bac4b6198e9d91af 100644 (file)
@@ -937,7 +937,11 @@ static int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb)
        hdr = (struct ieee80211_hdr *)skb->data;
        fc = le16_to_cpu(hdr->frame_control);
 
-       if (fc & IEEE80211_FCTL_PROTECTED) {
+       /* FW delivers WEP Shared Auth frame with Protected Bit set and
+        * encrypted payload. However in case of PMF it delivers decrypted
+        * frames with Protected Bit set. */
+       if (ieee80211_has_protected(hdr->frame_control) &&
+           !ieee80211_is_auth(hdr->frame_control)) {
                status->flag |= RX_FLAG_DECRYPTED | RX_FLAG_IV_STRIPPED |
                                RX_FLAG_MMIC_STRIPPED;
                hdr->frame_control = __cpu_to_le16(fc &