cfg80211: remove enum ieee80211_band
[deliverable/linux.git] / drivers / net / wireless / intel / iwlwifi / mvm / rx.c
index 145ec68ce6f9a398c3bed94f3f4d4f5d2eb38e64..263e8a8576b73268e064be161f7784fbd646010d 100644 (file)
@@ -7,6 +7,7 @@
  *
  * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
+ * Copyright(c) 2016 Intel Deutschland GmbH
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of version 2 of the GNU General Public License as
@@ -130,7 +131,7 @@ static void iwl_mvm_pass_packet_to_mac80211(struct iwl_mvm *mvm,
                                fraglen, rxb->truesize);
        }
 
-       ieee80211_rx_napi(mvm->hw, skb, napi);
+       ieee80211_rx_napi(mvm->hw, NULL, skb, napi);
 }
 
 /*
@@ -318,15 +319,13 @@ void iwl_mvm_rx_rx_mpdu(struct iwl_mvm *mvm, struct napi_struct *napi,
        rx_status->device_timestamp = le32_to_cpu(phy_info->system_timestamp);
        rx_status->band =
                (phy_info->phy_flags & cpu_to_le16(RX_RES_PHY_FLAGS_BAND_24)) ?
-                               IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ;
+                               NL80211_BAND_2GHZ : NL80211_BAND_5GHZ;
        rx_status->freq =
                ieee80211_channel_to_frequency(le16_to_cpu(phy_info->channel),
                                               rx_status->band);
-       /*
-        * TSF as indicated by the fw is at INA time, but mac80211 expects the
-        * TSF at the beginning of the MPDU.
-        */
-       /*rx_status->flag |= RX_FLAG_MACTIME_MPDU;*/
+
+       /* TSF as indicated by the firmware  is at INA time */
+       rx_status->flag |= RX_FLAG_MACTIME_PLCP_START;
 
        iwl_mvm_get_signal_strength(mvm, phy_info, rx_status);
 
@@ -448,6 +447,12 @@ void iwl_mvm_rx_rx_mpdu(struct iwl_mvm *mvm, struct napi_struct *napi,
        iwl_mvm_update_frame_stats(mvm, rate_n_flags,
                                   rx_status->flag & RX_FLAG_AMPDU_DETAILS);
 #endif
+
+       if (unlikely((ieee80211_is_beacon(hdr->frame_control) ||
+                     ieee80211_is_probe_resp(hdr->frame_control)) &&
+                    mvm->sched_scan_pass_all == SCHED_SCAN_PASS_ALL_ENABLED))
+               mvm->sched_scan_pass_all = SCHED_SCAN_PASS_ALL_FOUND;
+
        iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, hdr, len, ampdu_status,
                                        crypt_len, rxb);
 }
@@ -622,3 +627,51 @@ void iwl_mvm_rx_statistics(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb)
 {
        iwl_mvm_handle_rx_statistics(mvm, rxb_addr(rxb));
 }
+
+void iwl_mvm_window_status_notif(struct iwl_mvm *mvm,
+                                struct iwl_rx_cmd_buffer *rxb)
+{
+       struct iwl_rx_packet *pkt = rxb_addr(rxb);
+       struct iwl_ba_window_status_notif *notif = (void *)pkt->data;
+       int i;
+       u32 pkt_len = iwl_rx_packet_payload_len(pkt);
+
+       if (WARN_ONCE(pkt_len != sizeof(*notif),
+                     "Received window status notification of wrong size (%u)\n",
+                     pkt_len))
+               return;
+
+       rcu_read_lock();
+       for (i = 0; i < BA_WINDOW_STREAMS_MAX; i++) {
+               struct ieee80211_sta *sta;
+               u8 sta_id, tid;
+               u64 bitmap;
+               u32 ssn;
+               u16 ratid;
+               u16 received_mpdu;
+
+               ratid = le16_to_cpu(notif->ra_tid[i]);
+               /* check that this TID is valid */
+               if (!(ratid & BA_WINDOW_STATUS_VALID_MSK))
+                       continue;
+
+               received_mpdu = le16_to_cpu(notif->mpdu_rx_count[i]);
+               if (received_mpdu == 0)
+                       continue;
+
+               tid = ratid & BA_WINDOW_STATUS_TID_MSK;
+               /* get the station */
+               sta_id = (ratid & BA_WINDOW_STATUS_STA_ID_MSK)
+                        >> BA_WINDOW_STATUS_STA_ID_POS;
+               sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]);
+               if (IS_ERR_OR_NULL(sta))
+                       continue;
+               bitmap = le64_to_cpu(notif->bitmap[i]);
+               ssn = le32_to_cpu(notif->start_seq_num[i]);
+
+               /* update mac80211 with the bitmap for the reordering buffer */
+               ieee80211_mark_rx_ba_filtered_frames(sta, tid, ssn, bitmap,
+                                                    received_mpdu);
+       }
+       rcu_read_unlock();
+}
This page took 0.034053 seconds and 5 git commands to generate.